Skip to content

Commit c0ed3c3

Browse files
committed
Remove one more use of a custom helper
1 parent fd42f50 commit c0ed3c3

File tree

1 file changed

+4
-29
lines changed

1 file changed

+4
-29
lines changed

tests/mock_vws/test_update_target.py

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,6 @@ def test_existing_target_name(
613613
@staticmethod
614614
def test_same_name_given(
615615
image_file_success_state_low_rating: io.BytesIO,
616-
vuforia_database: VuforiaDatabase,
617616
vws_client: VWS,
618617
) -> None:
619618
"""
@@ -630,19 +629,7 @@ def test_same_name_given(
630629
)
631630

632631
vws_client.wait_for_target_processed(target_id=target_id)
633-
634-
response = _update_target(
635-
vuforia_database=vuforia_database,
636-
data={"name": name},
637-
target_id=target_id,
638-
)
639-
640-
assert_vws_failure(
641-
response=response,
642-
status_code=HTTPStatus.OK,
643-
result_code=ResultCodes.SUCCESS,
644-
)
645-
632+
vws_client.update_target(target_id=target_id, name=name)
646633
target_details = vws_client.get_target_record(target_id=target_id)
647634
assert target_details.target_record.name == name
648635

@@ -658,30 +645,18 @@ class TestImage:
658645

659646
@staticmethod
660647
def test_image_valid(
661-
vuforia_database: VuforiaDatabase,
662648
image_files_failed_state: io.BytesIO,
663649
target_id: str,
664650
vws_client: VWS,
665651
) -> None:
666652
"""
667653
JPEG and PNG files in the RGB and greyscale color spaces are allowed.
668654
"""
669-
image_file = image_files_failed_state
670-
image_data = image_file.read()
671-
image_data_encoded = base64.b64encode(s=image_data).decode("ascii")
672-
673655
vws_client.wait_for_target_processed(target_id=target_id)
674656

675-
response = _update_target(
676-
vuforia_database=vuforia_database,
677-
data={"image": image_data_encoded},
657+
vws_client.update_target(
678658
target_id=target_id,
679-
)
680-
681-
assert_vws_response(
682-
response=response,
683-
status_code=HTTPStatus.OK,
684-
result_code=ResultCodes.SUCCESS,
659+
image=image_files_failed_state,
685660
)
686661

687662
@staticmethod
@@ -696,7 +671,7 @@ def test_bad_image_format_or_color_space(
696671
RGB color space.
697672
"""
698673
vws_client.wait_for_target_processed(target_id=target_id)
699-
with pytest.raises(BadImage) as exc:
674+
with pytest.raises(expected_exception=BadImage) as exc:
700675
vws_client.update_target(target_id=target_id, image=bad_image_file)
701676

702677
status_code = exc.value.response.status_code

0 commit comments

Comments
 (0)