Skip to content

Commit fd42f50

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

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/mock_vws/test_update_target.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
ImageTooLarge,
2222
MetadataTooLarge,
2323
ProjectInactive,
24+
TargetNameExist,
2425
)
2526
from vws.reports import TargetStatuses
2627
from vws_auth_tools import authorization_header, rfc_1123_date
@@ -570,7 +571,6 @@ def test_name_invalid(
570571
@staticmethod
571572
def test_existing_target_name(
572573
image_file_success_state_low_rating: io.BytesIO,
573-
vuforia_database: VuforiaDatabase,
574574
vws_client: VWS,
575575
) -> None:
576576
"""
@@ -598,14 +598,14 @@ def test_existing_target_name(
598598
vws_client.wait_for_target_processed(target_id=first_target_id)
599599
vws_client.wait_for_target_processed(target_id=second_target_id)
600600

601-
response = _update_target(
602-
vuforia_database=vuforia_database,
603-
data={"name": first_target_name},
604-
target_id=second_target_id,
605-
)
601+
with pytest.raises(expected_exception=TargetNameExist) as exc:
602+
vws_client.update_target(
603+
target_id=second_target_id,
604+
name=first_target_name,
605+
)
606606

607607
assert_vws_failure(
608-
response=response,
608+
response=exc.value.response,
609609
status_code=HTTPStatus.FORBIDDEN,
610610
result_code=ResultCodes.TARGET_NAME_EXIST,
611611
)

0 commit comments

Comments
 (0)