File tree Expand file tree Collapse file tree 3 files changed +25
-17
lines changed Expand file tree Collapse file tree 3 files changed +25
-17
lines changed Original file line number Diff line number Diff line change @@ -478,14 +478,21 @@ def test_corrupted(
478
478
vws_client : VWS ,
479
479
) -> None :
480
480
"""
481
- No error is returned when the given image is corrupted.
481
+ An error is returned when the given image is corrupted.
482
482
"""
483
- vws_client .add_target (
484
- name = "example_name" ,
485
- width = 1 ,
486
- image = corrupted_image_file ,
487
- application_metadata = None ,
488
- active_flag = True ,
483
+ with pytest .raises (expected_exception = BadImageError ) as exc :
484
+ vws_client .add_target (
485
+ name = "example_name" ,
486
+ width = 1 ,
487
+ image = corrupted_image_file ,
488
+ application_metadata = None ,
489
+ active_flag = True ,
490
+ )
491
+
492
+ assert_vws_failure (
493
+ response = exc .value .response ,
494
+ status_code = HTTPStatus .UNPROCESSABLE_ENTITY ,
495
+ result_code = ResultCodes .BAD_IMAGE ,
489
496
)
490
497
491
498
@staticmethod
Original file line number Diff line number Diff line change @@ -146,7 +146,6 @@ def test_target_quality(
146
146
vws_client : VWS ,
147
147
high_quality_image : io .BytesIO ,
148
148
image_file_success_state_low_rating : io .BytesIO ,
149
- corrupted_image_file : io .BytesIO ,
150
149
) -> None :
151
150
"""
152
151
The target tracking rating is as expected.
@@ -159,14 +158,9 @@ def test_target_quality(
159
158
vws_client = vws_client ,
160
159
image_file = image_file_success_state_low_rating ,
161
160
)
162
- corrupted_image_file_tracking_rating = _get_target_tracking_rating (
163
- vws_client = vws_client ,
164
- image_file = corrupted_image_file ,
165
- )
166
161
assert (
167
162
high_quality_image_tracking_rating
168
163
> low_quality_image_tracking_rating
169
- >= corrupted_image_file_tracking_rating
170
164
)
171
165
172
166
Original file line number Diff line number Diff line change @@ -670,12 +670,19 @@ def test_corrupted(
670
670
target_id : str ,
671
671
) -> None :
672
672
"""
673
- No error is returned when the given image is corrupted.
673
+ An error is returned when the given image is corrupted.
674
674
"""
675
675
vws_client .wait_for_target_processed (target_id = target_id )
676
- vws_client .update_target (
677
- target_id = target_id ,
678
- image = corrupted_image_file ,
676
+ with pytest .raises (expected_exception = BadImageError ) as exc :
677
+ vws_client .update_target (
678
+ target_id = target_id ,
679
+ image = corrupted_image_file ,
680
+ )
681
+
682
+ assert_vws_failure (
683
+ response = exc .value .response ,
684
+ status_code = HTTPStatus .UNPROCESSABLE_ENTITY ,
685
+ result_code = ResultCodes .BAD_IMAGE ,
679
686
)
680
687
681
688
@staticmethod
You can’t perform that action at this time.
0 commit comments