forked from github/pelican
More ruff fixes in files: stop ignoring C408, UP007, PLR5501, B006
This commit is contained in:
parent
3624bcdbf4
commit
7577dd7603
16 changed files with 72 additions and 82 deletions
|
|
@ -314,7 +314,7 @@ class TestPage(TestBase):
|
|||
args["settings"] = settings
|
||||
|
||||
# Tag
|
||||
args["content"] = "A simple test, with a " '<a href="|tag|tagname">link</a>'
|
||||
args["content"] = 'A simple test, with a <a href="|tag|tagname">link</a>'
|
||||
page = Page(**args)
|
||||
content = page.get_content("http://notmyidea.org")
|
||||
self.assertEqual(
|
||||
|
|
@ -326,9 +326,7 @@ class TestPage(TestBase):
|
|||
)
|
||||
|
||||
# Category
|
||||
args["content"] = (
|
||||
"A simple test, with a " '<a href="|category|category">link</a>'
|
||||
)
|
||||
args["content"] = 'A simple test, with a <a href="|category|category">link</a>'
|
||||
page = Page(**args)
|
||||
content = page.get_content("http://notmyidea.org")
|
||||
self.assertEqual(
|
||||
|
|
@ -350,7 +348,7 @@ class TestPage(TestBase):
|
|||
|
||||
# Classic intrasite link via filename
|
||||
args["content"] = (
|
||||
"A simple test, with a " '<a href="|filename|article.rst">link</a>'
|
||||
'A simple test, with a <a href="|filename|article.rst">link</a>'
|
||||
)
|
||||
content = Page(**args).get_content("http://notmyidea.org")
|
||||
self.assertEqual(
|
||||
|
|
@ -401,7 +399,7 @@ class TestPage(TestBase):
|
|||
|
||||
# also test for summary in metadata
|
||||
parsed = (
|
||||
"A simple summary test, with a " '<a href="|filename|article.rst">link</a>'
|
||||
'A simple summary test, with a <a href="|filename|article.rst">link</a>'
|
||||
)
|
||||
linked = (
|
||||
"A simple summary test, with a "
|
||||
|
|
@ -594,7 +592,7 @@ class TestPage(TestBase):
|
|||
|
||||
# An intrasite link via filename with %20 as a space
|
||||
args["content"] = (
|
||||
"A simple test, with a " '<a href="|filename|article%20spaces.rst">link</a>'
|
||||
'A simple test, with a <a href="|filename|article%20spaces.rst">link</a>'
|
||||
)
|
||||
content = Page(**args).get_content("http://notmyidea.org")
|
||||
self.assertEqual(
|
||||
|
|
@ -834,10 +832,10 @@ class TestStatic(LoggedTestCase):
|
|||
|
||||
otherdir_settings = self.settings.copy()
|
||||
otherdir_settings.update(
|
||||
dict(
|
||||
PAGE_SAVE_AS=os.path.join("otherpages", "{slug}.html"),
|
||||
PAGE_URL="otherpages/{slug}.html",
|
||||
)
|
||||
{
|
||||
"PAGE_SAVE_AS": os.path.join("otherpages", "{slug}.html"),
|
||||
"PAGE_URL": "otherpages/{slug}.html",
|
||||
}
|
||||
)
|
||||
otherdir_page = Page(
|
||||
content="other page",
|
||||
|
|
@ -892,7 +890,7 @@ class TestStatic(LoggedTestCase):
|
|||
"""
|
||||
customstatic = Static(
|
||||
content=None,
|
||||
metadata=dict(save_as="customfoo.jpg", url="customfoo.jpg"),
|
||||
metadata={"save_as": "customfoo.jpg", "url": "customfoo.jpg"},
|
||||
settings=self.settings,
|
||||
source_path=os.path.join("dir", "foo.jpg"),
|
||||
context=self.settings.copy(),
|
||||
|
|
@ -1066,9 +1064,9 @@ class TestStatic(LoggedTestCase):
|
|||
|
||||
static = Static(
|
||||
content=None,
|
||||
metadata=dict(
|
||||
status="draft",
|
||||
),
|
||||
metadata={
|
||||
"status": "draft",
|
||||
},
|
||||
settings=self.settings,
|
||||
source_path=os.path.join("dir", "foo.jpg"),
|
||||
context=self.settings.copy(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue