From 36cf98a91c390ce0a6d256b55c34197bc5293e7d Mon Sep 17 00:00:00 2001 From: Abel Luck Date: Mon, 30 Mar 2026 15:10:47 +0200 Subject: [PATCH] fix output paths --- .gitignore | 2 ++ repub/config.py | 2 +- repub/job_runner.py | 2 +- tests/test_config.py | 2 +- tests/test_file_feeds.py | 2 +- tests/test_scheduler_runtime.py | 10 ++++++---- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index bf0de74..6358b46 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ logs archive *egg-info *.db +*.db-shm +*.db-wal diff --git a/repub/config.py b/repub/config.py index 38cbf56..517d69c 100644 --- a/repub/config.py +++ b/repub/config.py @@ -192,7 +192,7 @@ def build_feed_settings( { "REPUBLISHER_OUT_DIR": str(out_dir), "FEEDS": { - str(out_dir / f"{feed_slug}.rss"): { + str(feed_dir / "feed.rss"): { "format": "rss", "postprocessing": [], "feed_name": feed_slug, diff --git a/repub/job_runner.py b/repub/job_runner.py index 9ad69c7..28fb025 100644 --- a/repub/job_runner.py +++ b/repub/job_runner.py @@ -160,7 +160,7 @@ def generate_pangea_feed( ), results=ResultsConfig( output_to_file_p=True, - output_file_name="rss.xml", + output_file_name="pangea.rss", output_directory=resolved_out_dir, ), logging=LoggingConfig( diff --git a/tests/test_config.py b/tests/test_config.py index 55d7063..23c4830 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -146,7 +146,7 @@ def test_build_feed_settings_derives_output_paths_from_feed_slug( assert feed_settings["VIDEO_STORE"] == str(out_dir / "info-marti" / "video") assert feed_settings["FILES_STORE"] == str(out_dir / "info-marti" / "files") assert feed_settings["FEEDS"] == { - str(out_dir / "info-marti.rss"): { + str(out_dir / "info-marti" / "feed.rss"): { "format": "rss", "postprocessing": [], "feed_name": "info-marti", diff --git a/tests/test_file_feeds.py b/tests/test_file_feeds.py index 835bc8e..b63dab1 100644 --- a/tests/test_file_feeds.py +++ b/tests/test_file_feeds.py @@ -29,7 +29,7 @@ DOWNLOAD_TIMEOUT = 5 exit_code = entrypoint_module.entrypoint(["--config", str(config_path)]) - output_path = tmp_path / "out" / "local-file.rss" + output_path = tmp_path / "out" / "local-file" / "feed.rss" assert exit_code == 0 assert output_path.exists() output = output_path.read_text(encoding="utf-8") diff --git a/tests/test_scheduler_runtime.py b/tests/test_scheduler_runtime.py index 30385e5..05e9623 100644 --- a/tests/test_scheduler_runtime.py +++ b/tests/test_scheduler_runtime.py @@ -129,7 +129,7 @@ def test_job_runtime_run_now_writes_log_and_stats_and_marks_success( assert execution.bytes_count > 0 assert artifacts.log_path.exists() assert artifacts.stats_path.exists() - output_path = tmp_path / "out" / "manual-source.rss" + output_path = tmp_path / "out" / "manual-source" / "feed.rss" assert output_path.exists() output_text = output_path.read_text(encoding="utf-8") assert "Local Demo Feed" in output_text @@ -246,7 +246,9 @@ def test_job_runtime_start_reconciles_stale_running_execution(tmp_path: Path) -> runtime.shutdown() -def test_generate_pangea_feed_writes_rss_file(monkeypatch, tmp_path: Path) -> None: +def test_generate_pangea_feed_writes_pangea_rss_file( + monkeypatch, tmp_path: Path +) -> None: class StubPangeaFeed: def __init__(self, config, feeds): self.config = config @@ -259,7 +261,7 @@ def test_generate_pangea_feed_writes_rss_file(monkeypatch, tmp_path: Path) -> No return None def disgorge(self, slug: str): - output_path = self.config.results.output_directory / slug / "rss.xml" + output_path = self.config.results.output_directory / slug / "pangea.rss" output_path.parent.mkdir(parents=True, exist_ok=True) output_path.write_text( "Pangea Fixture\n", @@ -289,7 +291,7 @@ def test_generate_pangea_feed_writes_rss_file(monkeypatch, tmp_path: Path) -> No log_path=tmp_path / "out" / "logs" / "pangea.log", ) - assert output_path == (tmp_path / "out" / "pangea-source" / "rss.xml") + assert output_path == (tmp_path / "out" / "pangea-source" / "pangea.rss") assert output_path.exists() assert "Pangea Fixture" in output_path.read_text(encoding="utf-8")