|
21 | 21 | ImageTooLarge, |
22 | 22 | MetadataTooLarge, |
23 | 23 | ProjectInactive, |
| 24 | + TargetNameExist, |
24 | 25 | ) |
25 | 26 | from vws.reports import TargetStatuses |
26 | 27 | from vws_auth_tools import authorization_header, rfc_1123_date |
@@ -570,7 +571,6 @@ def test_name_invalid( |
570 | 571 | @staticmethod |
571 | 572 | def test_existing_target_name( |
572 | 573 | image_file_success_state_low_rating: io.BytesIO, |
573 | | - vuforia_database: VuforiaDatabase, |
574 | 574 | vws_client: VWS, |
575 | 575 | ) -> None: |
576 | 576 | """ |
@@ -598,14 +598,14 @@ def test_existing_target_name( |
598 | 598 | vws_client.wait_for_target_processed(target_id=first_target_id) |
599 | 599 | vws_client.wait_for_target_processed(target_id=second_target_id) |
600 | 600 |
|
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 | + ) |
606 | 606 |
|
607 | 607 | assert_vws_failure( |
608 | | - response=response, |
| 608 | + response=exc.value.response, |
609 | 609 | status_code=HTTPStatus.FORBIDDEN, |
610 | 610 | result_code=ResultCodes.TARGET_NAME_EXIST, |
611 | 611 | ) |
|
0 commit comments