Skip to content

Commit 4f79d47

Browse files
committed
Test TargetStatuses FAILED
1 parent 4fdf268 commit 4f79d47

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

tests/test_cloud_reco_exceptions.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,8 @@ def test_inactive_project(
116116
with pytest.raises(InactiveProjectError) as exc:
117117
cloud_reco_client.query(image=high_quality_image)
118118

119-
assert exc.value.response.status_code == HTTPStatus.FORBIDDEN
119+
response = exc.value.response
120+
assert response.status_code == HTTPStatus.FORBIDDEN
121+
# We need one test which checks tell position
122+
# and so we choose this one almost at random.
123+
assert response.tell_position != 0

tests/test_vws.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,27 @@ def test_get_target_record(
337337

338338
assert result.status == TargetStatuses.PROCESSING
339339

340+
@staticmethod
341+
def test_get_failed(
342+
vws_client: VWS,
343+
image_file_failed_state: io.BytesIO,
344+
) -> None:
345+
"""
346+
Check that the report works with a failed target.
347+
"""
348+
target_id = vws_client.add_target(
349+
name="x",
350+
width=1,
351+
image=image_file_failed_state,
352+
active_flag=True,
353+
application_metadata=None,
354+
)
355+
356+
vws_client.wait_for_target_processed(target_id=target_id)
357+
result = vws_client.get_target_record(target_id=target_id)
358+
359+
assert result.status == TargetStatuses.FAILED
360+
340361

341362
class TestWaitForTargetProcessed:
342363
"""

0 commit comments

Comments
 (0)