feat(media-routing): implement 007 media article routing, runtime architecture diagram and update graphify knowledge graph
This commit is contained in:
@@ -18,6 +18,7 @@ from scripts.extract_article_contents import (
|
||||
ExtractedArticle,
|
||||
ExtractionBatchReport,
|
||||
InputArticle,
|
||||
MediaClassification,
|
||||
NewspaperData,
|
||||
NewspaperExtractor,
|
||||
ReadabilityData,
|
||||
@@ -321,13 +322,17 @@ def test_e2e_live_article_extraction(tmp_path: Path):
|
||||
|
||||
out_file = tmp_path / "e2e_live_extracted.json"
|
||||
|
||||
# Executa o batch real com limite de 1 notícia
|
||||
report = process_batch(
|
||||
input_path=live_input_file,
|
||||
output_path=out_file,
|
||||
limit=1,
|
||||
silent=True,
|
||||
)
|
||||
# Executa o batch real com limite de 1 notícia simulando classificação textual
|
||||
with patch(
|
||||
"scripts.extract_article_contents.classify_media_content",
|
||||
return_value=(MediaClassification(content_type="text", media_type=None), None),
|
||||
):
|
||||
report = process_batch(
|
||||
input_path=live_input_file,
|
||||
output_path=out_file,
|
||||
limit=1,
|
||||
silent=True,
|
||||
)
|
||||
|
||||
assert report.total_articles == 1
|
||||
assert report.successful_articles == 1
|
||||
@@ -364,9 +369,14 @@ def test_e2e_cli_live_execution(tmp_path: Path):
|
||||
pytest.skip("Arquivo out/river_plate.json não encontrado para teste E2E.")
|
||||
|
||||
out_file = tmp_path / "e2e_cli_live.json"
|
||||
exit_code = main(["-i", str(live_input_file), "-o", str(out_file), "--limit", "1", "-s"])
|
||||
with patch(
|
||||
"scripts.extract_article_contents.classify_media_content",
|
||||
return_value=(MediaClassification(content_type="text", media_type=None), None),
|
||||
):
|
||||
exit_code = main(["-i", str(live_input_file), "-o", str(out_file), "--limit", "1", "-s"])
|
||||
|
||||
assert exit_code == 0
|
||||
assert out_file.exists()
|
||||
data = json.loads(out_file.read_text(encoding="utf-8"))
|
||||
assert data["successful_articles"] == 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user