fix: fixed tests
This commit is contained in:
+6
-9
@@ -8,7 +8,7 @@ from renderer.fifty_ohm_html_renderer import FiftyOhmHtmlRenderer
|
||||
|
||||
|
||||
def parse_katalog():
|
||||
with open("data/fragenkatalog3b.json") as fragenkatalog_file:
|
||||
with open("data/git_content/contents/questions/fragenkatalog3b.json") as fragenkatalog_file:
|
||||
fragenkatalog = json.load(fragenkatalog_file)
|
||||
|
||||
questions = {}
|
||||
@@ -31,14 +31,12 @@ question_template = env.get_template("question.html")
|
||||
questions = parse_katalog()
|
||||
|
||||
|
||||
def question_stub(input):
|
||||
def question_stub(number):
|
||||
"""Combines the original question dataset from BNetzA with our internal metadata"""
|
||||
with open("data/metadata3b.json") as metadata_file:
|
||||
with open("data/git_content/contents/questions/metadata3b.json") as metadata_file:
|
||||
metadata = json.load(metadata_file)
|
||||
number = metadata[f"{input}"]["number"] # Fragennummer z.B. AB123
|
||||
|
||||
question = questions[number]
|
||||
metadata = metadata[f"{input}"]
|
||||
metadata = metadata[f"{number}"]
|
||||
|
||||
if "answer_a" in question:
|
||||
answers = [question["answer_a"], question["answer_b"], question["answer_c"], question["answer_d"]]
|
||||
@@ -71,9 +69,8 @@ def question_stub(input):
|
||||
|
||||
|
||||
def include_stub(include):
|
||||
with open("data/includes.json") as file:
|
||||
includes = json.load(file)
|
||||
return includes.get(include)
|
||||
with open(f"data/git_content/contents/html/{include}.html") as file:
|
||||
return file.read()
|
||||
|
||||
|
||||
@pytest.mark.skip("Requires special files")
|
||||
|
||||
Reference in New Issue
Block a user