test: update 3 tests broken by terminal-step completed guard

The previous fix (requiring send_to_all_destinations to be present
before marking a file as completed) broke 3 tests that used only
partial step sets and expected "completed":

- test_coverage_polish.py::TestFileQueriesDeduplicationEnabled::
  test_deduplication_enabled_adds_check_for_duplicates
- test_file_listing.py::TestFileListingPagination::
  test_processing_status_included
- test_file_listing.py::TestFileDetailEndpoint::
  test_file_detail_status_determination

Add send_to_all_destinations: success to each test's dataset so
"completed" status is reached correctly under the new semantics.

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-27 01:04:42 +00:00
parent baa412b172
commit 9795ca0d52
2 changed files with 23 additions and 20 deletions
+7 -6
View File
@@ -477,12 +477,13 @@ class TestFileQueriesDeduplicationEnabled:
db_session.add(file1)
db_session.flush()
step = FileProcessingStep(
file_id=file1.id,
step_name="check_for_duplicates",
status="success",
)
db_session.add(step)
for step_name in ("check_for_duplicates", "send_to_all_destinations"):
step = FileProcessingStep(
file_id=file1.id,
step_name=step_name,
status="success",
)
db_session.add(step)
db_session.commit()
query = db_session.query(FileRecord)
+16 -14
View File
@@ -187,13 +187,14 @@ class TestFileListingPagination:
db_session.add(file_record)
db_session.commit()
# Add a processing step (used for status determination)
step = FileProcessingStep(
file_id=file_record.id,
step_name="extract_text",
status="success",
)
db_session.add(step)
# Add processing steps (used for status determination)
for step_name in ("extract_text", "send_to_all_destinations"):
step = FileProcessingStep(
file_id=file_record.id,
step_name=step_name,
status="success",
)
db_session.add(step)
db_session.commit()
response = client.get("/api/files")
@@ -287,13 +288,14 @@ class TestFileDetailEndpoint:
assert response.status_code == 200
assert response.json()["processing_status"]["status"] == "pending"
# Test 2: Success step = completed
step = FileProcessingStep(
file_id=file_record.id,
step_name="extract_text",
status="success",
)
db_session.add(step)
# Test 2: Success step including terminal step = completed
for step_name in ("extract_text", "send_to_all_destinations"):
step = FileProcessingStep(
file_id=file_record.id,
step_name=step_name,
status="success",
)
db_session.add(step)
db_session.commit()
response = client.get(f"/api/files/{file_record.id}")