Skip to content

Commit e1d52ef

Browse files
Merge pull request #1899 from VWS-Python/bump-mock
Remove ActiveMatchingTargetsDeleteProcessing - VWS no longer has this…
2 parents bdf6804 + 42e6649 commit e1d52ef

File tree

5 files changed

+4
-43
lines changed

5 files changed

+4
-43
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Changelog
44
Next
55
----
66

7+
* Breaking change: the ``vws.exceptions.custom_exceptions.ActiveMatchingTargetsDeleteProcessing`` exception has been removed as Vuforia no longer returns this error.
8+
79
2023.03.25
810
------------
911

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ dev = [
234234
"Pygments==2.15.1",
235235
"Sphinx-Substitution-Extensions==2022.2.16",
236236
"Sphinx==7.0.1",
237-
"VWS-Python-Mock==2023.4.8",
237+
"VWS-Python-Mock==2023.5.21",
238238
"VWS-Test-Fixtures==2023.3.5",
239239
"black==23.3.0",
240240
"check-manifest==0.49",

src/vws/exceptions/custom_exceptions.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,3 @@ class TargetProcessingTimeout(Exception):
2424
"""
2525
Exception raised when waiting for a target to be processed times out.
2626
"""
27-
28-
29-
class ActiveMatchingTargetsDeleteProcessing(Exception):
30-
"""
31-
Exception raised when a query is made with an image which matches a target
32-
which has recently been deleted.
33-
"""

src/vws/query.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
RequestTimeTooSkewed,
2222
)
2323
from vws.exceptions.custom_exceptions import (
24-
ActiveMatchingTargetsDeleteProcessing,
2524
RequestEntityTooLarge,
2625
)
2726
from vws.include_target_data import CloudRecoIncludeTargetData
@@ -95,8 +94,6 @@ def query(
9594
file in the grayscale or RGB color space.
9695
~vws.exceptions.custom_exceptions.RequestEntityTooLarge: The given
9796
image is too large.
98-
~vws.exceptions.custom_exceptions.ActiveMatchingTargetsDeleteProcessing:
99-
The given image matches a target which was recently deleted.
10097
10198
Returns:
10299
An ordered list of target details of matching targets.
@@ -148,9 +145,6 @@ def query(
148145
if "Integer out of range" in response.text:
149146
raise MaxNumResultsOutOfRange(response=response)
150147

151-
if "No content to map due to end-of-input" in response.text:
152-
raise ActiveMatchingTargetsDeleteProcessing
153-
154148
result_code = response.json()["result_code"]
155149
if result_code != "Success":
156150
exception = {

tests/test_cloud_reco_exceptions.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from __future__ import annotations
66

7-
import time
87
import uuid
98
from http import HTTPStatus
109
from typing import TYPE_CHECKING
@@ -13,7 +12,7 @@
1312
from mock_vws import MockVWS
1413
from mock_vws.database import VuforiaDatabase
1514
from mock_vws.states import States
16-
from vws import VWS, CloudRecoService
15+
from vws import CloudRecoService
1716
from vws.exceptions.base_exceptions import CloudRecoException
1817
from vws.exceptions.cloud_reco_exceptions import (
1918
AuthenticationFailure,
@@ -23,7 +22,6 @@
2322
RequestTimeTooSkewed,
2423
)
2524
from vws.exceptions.custom_exceptions import (
26-
ActiveMatchingTargetsDeleteProcessing,
2725
RequestEntityTooLarge,
2826
)
2927

@@ -79,32 +77,6 @@ def test_cloudrecoexception_inheritance() -> None:
7977
assert issubclass(subclass, CloudRecoException)
8078

8179

82-
def test_active_matching_targets_delete_processing(
83-
vws_client: VWS,
84-
cloud_reco_client: CloudRecoService,
85-
high_quality_image: io.BytesIO,
86-
) -> None:
87-
"""
88-
A ``ActiveMatchingTargetsDeleteProcessing`` exception is raised when a
89-
target which has recently been deleted is matched.
90-
"""
91-
target_id = vws_client.add_target(
92-
name="x",
93-
width=1,
94-
image=high_quality_image,
95-
active_flag=True,
96-
application_metadata=None,
97-
)
98-
vws_client.wait_for_target_processed(target_id=target_id)
99-
vws_client.delete_target(target_id=target_id)
100-
# This matches the "query_recognizes_deletion_seconds" setting to
101-
# ``MockVWS``.
102-
query_recognizes_deletion_seconds = 2
103-
time.sleep(query_recognizes_deletion_seconds)
104-
with pytest.raises(ActiveMatchingTargetsDeleteProcessing):
105-
cloud_reco_client.query(image=high_quality_image)
106-
107-
10880
def test_authentication_failure(high_quality_image: io.BytesIO) -> None:
10981
"""
11082
An ``AuthenticationFailure`` exception is raised when the client access key

0 commit comments

Comments
 (0)