style: reformat files with ruff
This commit is contained in:
+1
-6
@@ -16,12 +16,7 @@ class DirectusAPI:
|
||||
params[k] = json.dumps(params[k])
|
||||
url = self.base_url + endpoint
|
||||
result = requests.get(
|
||||
url,
|
||||
params = params,
|
||||
headers = {
|
||||
"Authorization": f"Bearer {self.access_token}",
|
||||
"Cache-Control": "no-store"
|
||||
}
|
||||
url, params=params, headers={"Authorization": f"Bearer {self.access_token}", "Cache-Control": "no-store"}
|
||||
)
|
||||
return result
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class FiftyOhmLaTeXRenderer(LaTeXRenderer):
|
||||
Question,
|
||||
Picture,
|
||||
Photo,
|
||||
Table
|
||||
Table,
|
||||
)
|
||||
self.question_renderer = question_renderer
|
||||
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ class Include(BlockToken):
|
||||
|
||||
@classmethod
|
||||
def read(cls, lines):
|
||||
re.compile(r'')
|
||||
re.compile(r"")
|
||||
line = next(lines) # Consume the line with the include directive
|
||||
ident = re.match(r"^\s*\[include:\s*([^\]]+)\]", line).group(1)
|
||||
return ident
|
||||
|
||||
+1
-1
@@ -87,4 +87,4 @@ class Morse(SpanToken):
|
||||
return result
|
||||
|
||||
parse_inner = False
|
||||
pattern = re.compile(r'\[morse:\s*([^\]]+)\]')
|
||||
pattern = re.compile(r"\[morse:\s*([^\]]+)\]")
|
||||
|
||||
@@ -25,6 +25,7 @@ class Qso(BlockToken):
|
||||
def __init__(self, match):
|
||||
self.children = match
|
||||
|
||||
|
||||
class QsoLine(BlockToken):
|
||||
@classmethod
|
||||
def parse_line(cls, line):
|
||||
|
||||
@@ -69,11 +69,13 @@ def question_stub(input):
|
||||
answer_pictures=answer_pictures,
|
||||
)
|
||||
|
||||
|
||||
def include_stub(include):
|
||||
with open("data/includes.json") as file:
|
||||
includes = json.load(file)
|
||||
return includes.get(include)
|
||||
|
||||
|
||||
def test_html(capsys):
|
||||
with capsys.disabled():
|
||||
with open("test/acceptanceTest.md") as file:
|
||||
|
||||
@@ -7,7 +7,7 @@ from renderer.fifty_ohm_html_renderer import FiftyOhmHtmlRenderer
|
||||
@pytest.mark.html
|
||||
def test_include_html():
|
||||
assertions = {
|
||||
'[include:ident]': "ident\n",
|
||||
"[include:ident]": "ident\n",
|
||||
}
|
||||
|
||||
def test_function(input):
|
||||
|
||||
@@ -24,6 +24,7 @@ def test_question_html():
|
||||
for assertion in assertions:
|
||||
assert renderer.render(Document(assertion)) == assertions[assertion]
|
||||
|
||||
|
||||
@pytest.mark.html
|
||||
def test_question_translation_html():
|
||||
assertions = {
|
||||
@@ -34,7 +35,7 @@ def test_question_translation_html():
|
||||
}
|
||||
|
||||
def test_function(input):
|
||||
with open('data/metadata.json') as file:
|
||||
with open("data/metadata.json") as file:
|
||||
metadata = json.load(file)
|
||||
return metadata[f"{input}"].get("number")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user