This commit is contained in:
@@ -50,8 +50,7 @@ def test_network_snapshot_prefers_repository_data(
|
||||
track = sample_entities["track"]
|
||||
train = sample_entities["train"]
|
||||
|
||||
monkeypatch.setattr(StationRepository, "list_active",
|
||||
lambda self: [station])
|
||||
monkeypatch.setattr(StationRepository, "list_active", lambda self: [station])
|
||||
monkeypatch.setattr(TrackRepository, "list_all", lambda self: [track])
|
||||
monkeypatch.setattr(TrainRepository, "list_all", lambda self: [train])
|
||||
|
||||
@@ -59,8 +58,7 @@ def test_network_snapshot_prefers_repository_data(
|
||||
|
||||
assert snapshot["stations"]
|
||||
assert snapshot["stations"][0]["name"] == station.name
|
||||
assert snapshot["tracks"][0]["lengthMeters"] == pytest.approx(
|
||||
track.length_meters)
|
||||
assert snapshot["tracks"][0]["lengthMeters"] == pytest.approx(track.length_meters)
|
||||
assert snapshot["trains"][0]["designation"] == train.designation
|
||||
assert snapshot["trains"][0]["operatingTrackIds"] == []
|
||||
|
||||
@@ -76,5 +74,4 @@ def test_network_snapshot_falls_back_when_repositories_empty(
|
||||
|
||||
assert snapshot["stations"]
|
||||
assert snapshot["trains"]
|
||||
assert any(station["name"] ==
|
||||
"Central" for station in snapshot["stations"])
|
||||
assert any(station["name"] == "Central" for station in snapshot["stations"])
|
||||
|
||||
Reference in New Issue
Block a user