Skip to content

Commit 4f1babf

Browse files
committed
Passing test on real for update target
1 parent a101df2 commit 4f1babf

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tests/mock_vws/test_update_target.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import base64
66
import binascii
77
import io
8+
import uuid
89
from typing import Any, Union
910

1011
import pytest
@@ -960,3 +961,33 @@ def test_rating_can_change(
960961
assert new_tracking_rating in range(6)
961962

962963
assert original_tracking_rating != new_tracking_rating
964+
965+
966+
@pytest.mark.usefixtures('verify_mock_vuforia_inactive')
967+
class TestInactiveProject:
968+
"""
969+
Tests for inactive projects.
970+
"""
971+
972+
def test_inactive_project(
973+
self,
974+
inactive_database_keys: VuforiaDatabaseKeys,
975+
high_quality_image: io.BytesIO,
976+
) -> None:
977+
"""
978+
If the project is inactive, a FORBIDDEN response is returned.
979+
"""
980+
image = high_quality_image.read()
981+
image_data_encoded = base64.b64encode(image).decode('ascii')
982+
983+
response = update_target(
984+
vuforia_database_keys=inactive_database_keys,
985+
data={'image': image_data_encoded},
986+
target_id=uuid.uuid4().hex,
987+
)
988+
989+
assert_vws_failure(
990+
response=response,
991+
status_code=codes.FORBIDDEN,
992+
result_code=ResultCodes.PROJECT_INACTIVE,
993+
)

0 commit comments

Comments
 (0)