Skip to content

Commit bb0bf44

Browse files
committed
Merge remote-tracking branch 'origin/main' into adamtheturtle/custom-timeouts
# Conflicts: # tests/test_query.py # tests/test_vws.py
2 parents ff97779 + 69fac31 commit bb0bf44

File tree

2 files changed

+4
-57
lines changed

2 files changed

+4
-57
lines changed

tests/test_query.py

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def test_match(
4646
assert matching_target.target_id == target_id
4747

4848

49-
class TestCustomRequestTimeout:
50-
"""Tests for using a custom request timeout."""
49+
class TestDefaultRequestTimeout:
50+
"""Tests for the default request timeout."""
5151

5252
@staticmethod
5353
@pytest.mark.parametrize(
@@ -91,36 +91,6 @@ def test_default_timeout(
9191
matches = cloud_reco_client.query(image=image)
9292
assert not matches
9393

94-
@staticmethod
95-
def test_timeout_raises_on_slow_response(
96-
image: io.BytesIO | BinaryIO,
97-
) -> None:
98-
"""A short timeout raises an error when the server is slow."""
99-
with MockVWS(response_delay_seconds=0.5) as mock:
100-
database = VuforiaDatabase()
101-
mock.add_database(database=database)
102-
vws_client = VWS(
103-
server_access_key=database.server_access_key,
104-
server_secret_key=database.server_secret_key,
105-
)
106-
cloud_reco_client = CloudRecoService(
107-
client_access_key=database.client_access_key,
108-
client_secret_key=database.client_secret_key,
109-
request_timeout_seconds=0.1,
110-
)
111-
112-
target_id = vws_client.add_target(
113-
name="x",
114-
width=1,
115-
image=image,
116-
active_flag=True,
117-
application_metadata=None,
118-
)
119-
vws_client.wait_for_target_processed(target_id=target_id)
120-
121-
with pytest.raises(expected_exception=requests.exceptions.Timeout):
122-
cloud_reco_client.query(image=image)
123-
12494

12595
class TestCustomBaseVWQURL:
12696
"""Tests for using a custom base VWQ URL."""

tests/test_vws.py

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ def test_add_two_targets(
9393
)
9494

9595

96-
class TestCustomRequestTimeout:
97-
"""Tests for using a custom request timeout."""
96+
class TestDefaultRequestTimeout:
97+
"""Tests for the default request timeout."""
9898

9999
@staticmethod
100100
@pytest.mark.parametrize(
@@ -149,29 +149,6 @@ def test_default_timeout(
149149
application_metadata=None,
150150
)
151151

152-
@staticmethod
153-
def test_timeout_raises_on_slow_response(
154-
image: io.BytesIO | BinaryIO,
155-
) -> None:
156-
"""A short timeout raises an error when the server is slow."""
157-
with MockVWS(response_delay_seconds=0.5) as mock:
158-
database = VuforiaDatabase()
159-
mock.add_database(database=database)
160-
vws_client = VWS(
161-
server_access_key=database.server_access_key,
162-
server_secret_key=database.server_secret_key,
163-
request_timeout_seconds=0.1,
164-
)
165-
166-
with pytest.raises(expected_exception=requests.exceptions.Timeout):
167-
vws_client.add_target(
168-
name="x",
169-
width=1,
170-
image=image,
171-
active_flag=True,
172-
application_metadata=None,
173-
)
174-
175152

176153
class TestCustomBaseVWSURL:
177154
"""Tests for using a custom base VWS URL."""

0 commit comments

Comments
 (0)