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:
@@ -477,9 +477,10 @@ class TestFileQueriesDeduplicationEnabled:
|
|||||||
db_session.add(file1)
|
db_session.add(file1)
|
||||||
db_session.flush()
|
db_session.flush()
|
||||||
|
|
||||||
|
for step_name in ("check_for_duplicates", "send_to_all_destinations"):
|
||||||
step = FileProcessingStep(
|
step = FileProcessingStep(
|
||||||
file_id=file1.id,
|
file_id=file1.id,
|
||||||
step_name="check_for_duplicates",
|
step_name=step_name,
|
||||||
status="success",
|
status="success",
|
||||||
)
|
)
|
||||||
db_session.add(step)
|
db_session.add(step)
|
||||||
|
|||||||
@@ -187,10 +187,11 @@ class TestFileListingPagination:
|
|||||||
db_session.add(file_record)
|
db_session.add(file_record)
|
||||||
db_session.commit()
|
db_session.commit()
|
||||||
|
|
||||||
# Add a processing step (used for status determination)
|
# Add processing steps (used for status determination)
|
||||||
|
for step_name in ("extract_text", "send_to_all_destinations"):
|
||||||
step = FileProcessingStep(
|
step = FileProcessingStep(
|
||||||
file_id=file_record.id,
|
file_id=file_record.id,
|
||||||
step_name="extract_text",
|
step_name=step_name,
|
||||||
status="success",
|
status="success",
|
||||||
)
|
)
|
||||||
db_session.add(step)
|
db_session.add(step)
|
||||||
@@ -287,10 +288,11 @@ class TestFileDetailEndpoint:
|
|||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
assert response.json()["processing_status"]["status"] == "pending"
|
assert response.json()["processing_status"]["status"] == "pending"
|
||||||
|
|
||||||
# Test 2: Success step = completed
|
# Test 2: Success step including terminal step = completed
|
||||||
|
for step_name in ("extract_text", "send_to_all_destinations"):
|
||||||
step = FileProcessingStep(
|
step = FileProcessingStep(
|
||||||
file_id=file_record.id,
|
file_id=file_record.id,
|
||||||
step_name="extract_text",
|
step_name=step_name,
|
||||||
status="success",
|
status="success",
|
||||||
)
|
)
|
||||||
db_session.add(step)
|
db_session.add(step)
|
||||||
|
|||||||
Reference in New Issue
Block a user