|
@@ -20,7 +20,10 @@ def create_and_submit_scenario(config_id: str, client) -> Dict:
|
|
|
assert response.status_code == 201
|
|
|
|
|
|
scenario = response.json.get("scenario")
|
|
|
- assert (set(scenario) - set(json.load(open("tests/rest/json/expected/scenario.json")))) == set()
|
|
|
+ path = "tests/rest/json/expected/scenario.json"
|
|
|
+ with open(path) as file:
|
|
|
+ expected_scenario = json.load(file)
|
|
|
+ assert (set(scenario) - set(expected_scenario)) == set()
|
|
|
|
|
|
response = client.post(url_for("api.scenario_submit", scenario_id=scenario.get("id")))
|
|
|
assert response.status_code == 200
|
|
@@ -32,7 +35,10 @@ def get(url, name, client) -> Dict:
|
|
|
response = client.get(url)
|
|
|
returned_data = response.json.get(name)
|
|
|
|
|
|
- assert (set(returned_data) - set(json.load(open(f"tests/rest/json/expected/{name}.json")))) == set()
|
|
|
+ path = f"tests/rest/json/expected/{name}.json"
|
|
|
+ with open(path) as file:
|
|
|
+ expected_data = json.load(file)
|
|
|
+ assert (set(returned_data) - set(expected_data)) == set()
|
|
|
|
|
|
return returned_data
|
|
|
|