Skip to content

Commit

Permalink
tests: fix flaky test with hardcoded ID
Browse files Browse the repository at this point in the history
The actual ID would depend on the state of the DB, it
gets incremented whenever a work schedule is added

Signed-off-by: Eloi Charpentier <[email protected]>
  • Loading branch information
eckter committed Nov 4, 2024
1 parent c3d0409 commit 5eeb926
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/tests/test_stdcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@ def test_max_running_time(small_scenario: Scenario, fast_rolling_stock: int):
r = requests.post(url, json=payload)
response = r.json()
assert r.status_code == 200
for conflict in response["conflicts"]:
conflict["work_schedule_ids"] = [0] # We can't know the expected ID here
assert response == {
"status": "conflicts",
"conflicts": [
Expand All @@ -274,7 +276,7 @@ def test_max_running_time(small_scenario: Scenario, fast_rolling_stock: int):
"start_time": "2024-01-01T07:30:00Z",
"end_time": "2024-01-01T16:00:00Z",
"train_ids": [],
"work_schedule_ids": [3],
"work_schedule_ids": [0],
"requirements": [
{
"start_time": "2024-01-01T07:30:00Z",
Expand Down

0 comments on commit 5eeb926

Please sign in to comment.