mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
run() returns core and other file paths 🟥
This commit is contained in:
parent
0aa6a4fc30
commit
d8ec12065f
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"]
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 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
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue