mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
run() returns core and other file paths 🟥
This commit is contained in:
parent
fa450a37a3
commit
9efd4e34c2
1 changed files with 24 additions and 0 deletions
|
|
@ -73,6 +73,30 @@ def test_run_returns_file_paths() -> None:
|
||||||
assert result == ["/tmp/a.pdf", "/tmp/b.pdf"]
|
assert result == ["/tmp/a.pdf", "/tmp/b.pdf"]
|
||||||
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# run(): returns core + other file paths when get_other_files=True
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
def test_run_returns_core_and_other_file_paths() -> None:
|
||||||
|
# Arrange
|
||||||
|
mock_client = MagicMock(spec=PashubClient)
|
||||||
|
mock_client.get_uprn_by_job_id.return_value = None
|
||||||
|
mock_client.get_evidence_files_by_job_id.return_value = make_downloaded(
|
||||||
|
core=["/tmp/core.pdf"],
|
||||||
|
other=["/tmp/other.pdf"],
|
||||||
|
)
|
||||||
|
|
||||||
|
service = make_service(pashub_client=mock_client)
|
||||||
|
|
||||||
|
# Act
|
||||||
|
with patch("backend.pashub_fetcher.pashub_service.os.remove"):
|
||||||
|
result = service.run(make_request(get_other_files=True))
|
||||||
|
|
||||||
|
# Assert
|
||||||
|
assert result == ["/tmp/core.pdf", "/tmp/other.pdf"]
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# run(): skips upload when neither uprn nor hubspot_deal_id
|
# run(): skips upload when neither uprn nor hubspot_deal_id
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue