This commit is contained in:
@@ -58,7 +58,9 @@ def test_build_stage_plan_respects_skip_flags(tmp_path: Path) -> None:
|
||||
assert labels == ["Load stations", "Load tracks"]
|
||||
|
||||
|
||||
def test_main_dry_run_lists_plan(monkeypatch: pytest.MonkeyPatch, tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None:
|
||||
def test_main_dry_run_lists_plan(
|
||||
monkeypatch: pytest.MonkeyPatch, tmp_path: Path, capsys: pytest.CaptureFixture[str]
|
||||
) -> None:
|
||||
def fail(_args: list[str] | None) -> int: # pragma: no cover - defensive
|
||||
raise AssertionError("runner should not be invoked during dry run")
|
||||
|
||||
@@ -76,7 +78,9 @@ def test_main_dry_run_lists_plan(monkeypatch: pytest.MonkeyPatch, tmp_path: Path
|
||||
assert "Load tracks" in captured
|
||||
|
||||
|
||||
def test_main_executes_stages_in_order(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
|
||||
def test_main_executes_stages_in_order(
|
||||
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
|
||||
) -> None:
|
||||
calls: list[str] = []
|
||||
|
||||
def make_import(name: str):
|
||||
@@ -98,14 +102,12 @@ def test_main_executes_stages_in_order(monkeypatch: pytest.MonkeyPatch, tmp_path
|
||||
|
||||
return runner
|
||||
|
||||
monkeypatch.setattr(osm_refresh.stations_import, "main",
|
||||
make_import("stations_import"))
|
||||
monkeypatch.setattr(osm_refresh.tracks_import, "main",
|
||||
make_import("tracks_import"))
|
||||
monkeypatch.setattr(osm_refresh.stations_load, "main",
|
||||
make_load("stations_load"))
|
||||
monkeypatch.setattr(osm_refresh.tracks_load, "main",
|
||||
make_load("tracks_load"))
|
||||
monkeypatch.setattr(
|
||||
osm_refresh.stations_import, "main", make_import("stations_import")
|
||||
)
|
||||
monkeypatch.setattr(osm_refresh.tracks_import, "main", make_import("tracks_import"))
|
||||
monkeypatch.setattr(osm_refresh.stations_load, "main", make_load("stations_load"))
|
||||
monkeypatch.setattr(osm_refresh.tracks_load, "main", make_load("tracks_load"))
|
||||
|
||||
exit_code = osm_refresh.main(["--output-dir", str(tmp_path)])
|
||||
|
||||
@@ -118,7 +120,9 @@ def test_main_executes_stages_in_order(monkeypatch: pytest.MonkeyPatch, tmp_path
|
||||
]
|
||||
|
||||
|
||||
def test_main_skip_import_flags(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
|
||||
def test_main_skip_import_flags(
|
||||
monkeypatch: pytest.MonkeyPatch, tmp_path: Path
|
||||
) -> None:
|
||||
station_json = tmp_path / "stations.json"
|
||||
station_json.write_text("{}", encoding="utf-8")
|
||||
track_json = tmp_path / "tracks.json"
|
||||
@@ -139,8 +143,7 @@ def test_main_skip_import_flags(monkeypatch: pytest.MonkeyPatch, tmp_path: Path)
|
||||
|
||||
monkeypatch.setattr(osm_refresh.stations_import, "main", fail)
|
||||
monkeypatch.setattr(osm_refresh.tracks_import, "main", fail)
|
||||
monkeypatch.setattr(osm_refresh.stations_load,
|
||||
"main", record("stations_load"))
|
||||
monkeypatch.setattr(osm_refresh.stations_load, "main", record("stations_load"))
|
||||
monkeypatch.setattr(osm_refresh.tracks_load, "main", record("tracks_load"))
|
||||
|
||||
exit_code = osm_refresh.main(
|
||||
|
||||
Reference in New Issue
Block a user