Skip to content

Commit 2dfbdce

Browse files
committed
tests: fix flaky test with hardcoded ID
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]>
1 parent 6d9ed21 commit 2dfbdce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/tests/test_stdcm.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ def test_max_running_time(small_scenario: Scenario, fast_rolling_stock: int):
266266
r = requests.post(url, json=payload)
267267
response = r.json()
268268
assert r.status_code == 200
269+
for conflict in response["conflicts"]:
270+
conflict["work_schedule_ids"] = [0] # We can't know the expected ID here
269271
assert response == {
270272
"status": "conflicts",
271273
"conflicts": [
@@ -274,7 +276,7 @@ def test_max_running_time(small_scenario: Scenario, fast_rolling_stock: int):
274276
"start_time": "2024-01-01T07:30:00Z",
275277
"end_time": "2024-01-01T16:00:00Z",
276278
"train_ids": [],
277-
"work_schedule_ids": [3],
279+
"work_schedule_ids": [0],
278280
"requirements": [
279281
{
280282
"start_time": "2024-01-01T07:30:00Z",

0 commit comments

Comments
 (0)