Skip to content

Commit b95abdf

Browse files
committed
tests: fuzzer: fix train schedule request format
1 parent 44c1132 commit b95abdf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tests/fuzzer/fuzzer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def test_new_train(
148148
schedule_payload=schedule_payload,
149149
)
150150

151-
schedule_id = r.json()["ids"][0]
151+
schedule_id = r.json()[0]
152152
r = get_with_timeout(f"{editoast_url}train_schedule/{schedule_id}/result/")
153153
if r.status_code // 100 != 2:
154154
make_error(
@@ -551,7 +551,7 @@ def make_payload_schedule(scenario: Scenario, path: int, rolling_stock: int, pat
551551
"departure_time": random.randint(0, 3600 * 24),
552552
"allowances": make_random_allowances(path_length),
553553
"initial_speed": 0,
554-
"rolling_stock": rolling_stock,
554+
"rolling_stock_id": rolling_stock,
555555
"speed_limit_category": "foo",
556556
}
557557
],

tests/tests/test_regressions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def _schedule_with_payload(editoast_url, payload, accept_400):
3535
if r.status_code // 100 == 4 and accept_400:
3636
return None
3737
raise RuntimeError(f"Schedule error {r.status_code}: {r.content}")
38-
return r.json()["ids"][0]
38+
return r.json()[0]
3939

4040

4141
def _stdcm_with_payload(editoast_url: str, payload):
@@ -57,7 +57,7 @@ def _reproduce_test(path_to_json: Path, scenario: Scenario, rolling_stock_id: in
5757
stop_after_pathfinding = fuzzer_output["error_type"] == "PATHFINDING"
5858
stop_after_schedule = fuzzer_output["error_type"] == "SCHEDULE"
5959

60-
assert "small_infra" == fuzzer_output["infra_name"]
60+
assert fuzzer_output["infra_name"] in ["small_infra", "Small Infra"]
6161
timetable = scenario.timetable
6262
path_id = _pathfinding_with_payload(
6363
EDITOAST_URL, fuzzer_output["path_payload"], scenario.infra, stop_after_pathfinding

0 commit comments

Comments
 (0)