fix output paths
This commit is contained in:
parent
8af28c2f68
commit
36cf98a91c
6 changed files with 12 additions and 8 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -13,3 +13,5 @@ logs
|
||||||
archive
|
archive
|
||||||
*egg-info
|
*egg-info
|
||||||
*.db
|
*.db
|
||||||
|
*.db-shm
|
||||||
|
*.db-wal
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ def build_feed_settings(
|
||||||
{
|
{
|
||||||
"REPUBLISHER_OUT_DIR": str(out_dir),
|
"REPUBLISHER_OUT_DIR": str(out_dir),
|
||||||
"FEEDS": {
|
"FEEDS": {
|
||||||
str(out_dir / f"{feed_slug}.rss"): {
|
str(feed_dir / "feed.rss"): {
|
||||||
"format": "rss",
|
"format": "rss",
|
||||||
"postprocessing": [],
|
"postprocessing": [],
|
||||||
"feed_name": feed_slug,
|
"feed_name": feed_slug,
|
||||||
|
|
|
||||||
|
|
@ -160,7 +160,7 @@ def generate_pangea_feed(
|
||||||
),
|
),
|
||||||
results=ResultsConfig(
|
results=ResultsConfig(
|
||||||
output_to_file_p=True,
|
output_to_file_p=True,
|
||||||
output_file_name="rss.xml",
|
output_file_name="pangea.rss",
|
||||||
output_directory=resolved_out_dir,
|
output_directory=resolved_out_dir,
|
||||||
),
|
),
|
||||||
logging=LoggingConfig(
|
logging=LoggingConfig(
|
||||||
|
|
|
||||||
|
|
@ -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["VIDEO_STORE"] == str(out_dir / "info-marti" / "video")
|
||||||
assert feed_settings["FILES_STORE"] == str(out_dir / "info-marti" / "files")
|
assert feed_settings["FILES_STORE"] == str(out_dir / "info-marti" / "files")
|
||||||
assert feed_settings["FEEDS"] == {
|
assert feed_settings["FEEDS"] == {
|
||||||
str(out_dir / "info-marti.rss"): {
|
str(out_dir / "info-marti" / "feed.rss"): {
|
||||||
"format": "rss",
|
"format": "rss",
|
||||||
"postprocessing": [],
|
"postprocessing": [],
|
||||||
"feed_name": "info-marti",
|
"feed_name": "info-marti",
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ DOWNLOAD_TIMEOUT = 5
|
||||||
|
|
||||||
exit_code = entrypoint_module.entrypoint(["--config", str(config_path)])
|
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 exit_code == 0
|
||||||
assert output_path.exists()
|
assert output_path.exists()
|
||||||
output = output_path.read_text(encoding="utf-8")
|
output = output_path.read_text(encoding="utf-8")
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ def test_job_runtime_run_now_writes_log_and_stats_and_marks_success(
|
||||||
assert execution.bytes_count > 0
|
assert execution.bytes_count > 0
|
||||||
assert artifacts.log_path.exists()
|
assert artifacts.log_path.exists()
|
||||||
assert artifacts.stats_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()
|
assert output_path.exists()
|
||||||
output_text = output_path.read_text(encoding="utf-8")
|
output_text = output_path.read_text(encoding="utf-8")
|
||||||
assert "<title>Local Demo Feed</title>" in output_text
|
assert "<title>Local Demo Feed</title>" in output_text
|
||||||
|
|
@ -246,7 +246,9 @@ def test_job_runtime_start_reconciles_stale_running_execution(tmp_path: Path) ->
|
||||||
runtime.shutdown()
|
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:
|
class StubPangeaFeed:
|
||||||
def __init__(self, config, feeds):
|
def __init__(self, config, feeds):
|
||||||
self.config = config
|
self.config = config
|
||||||
|
|
@ -259,7 +261,7 @@ def test_generate_pangea_feed_writes_rss_file(monkeypatch, tmp_path: Path) -> No
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def disgorge(self, slug: str):
|
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.parent.mkdir(parents=True, exist_ok=True)
|
||||||
output_path.write_text(
|
output_path.write_text(
|
||||||
"<rss><channel><title>Pangea Fixture</title></channel></rss>\n",
|
"<rss><channel><title>Pangea Fixture</title></channel></rss>\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",
|
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 output_path.exists()
|
||||||
assert "Pangea Fixture" in output_path.read_text(encoding="utf-8")
|
assert "Pangea Fixture" in output_path.read_text(encoding="utf-8")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue