File tree Expand file tree Collapse file tree 1 file changed +10
-15
lines changed
Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -501,29 +501,24 @@ def test_image_valid(
501501 @staticmethod
502502 def test_bad_image_format_or_color_space (
503503 bad_image_file : io .BytesIO ,
504- vuforia_database : VuforiaDatabase ,
504+ vws_client : VWS ,
505505 ) -> None :
506506 """
507507 An `UNPROCESSABLE_ENTITY` response is returned if an image which is not
508508 a JPEG or PNG file is given, or if the given image is not in the
509509 greyscale or RGB color space.
510510 """
511- image_data = bad_image_file .read ()
512- image_data_encoded = base64 .b64encode (s = image_data ).decode ("ascii" )
513-
514- data = {
515- "name" : "example_name" ,
516- "width" : 1 ,
517- "image" : image_data_encoded ,
518- }
519-
520- response = _add_target_to_vws (
521- vuforia_database = vuforia_database ,
522- data = data ,
523- )
511+ with pytest .raises (expected_exception = BadImage ) as exc :
512+ vws_client .add_target (
513+ name = "example_name" ,
514+ width = 1 ,
515+ image = bad_image_file ,
516+ application_metadata = None ,
517+ active_flag = True ,
518+ )
524519
525520 assert_vws_failure (
526- response = response ,
521+ response = exc . value . response ,
527522 status_code = HTTPStatus .UNPROCESSABLE_ENTITY ,
528523 result_code = ResultCodes .BAD_IMAGE ,
529524 )
You can’t perform that action at this time.
0 commit comments