Skip to content

Commit aaaac54

Browse files
committed
Passing test for get duplicates
1 parent 0f4a11b commit aaaac54

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/vws/vws.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ def add_target(
190190
Add a target to a Vuforia Web Services database.
191191
192192
See
193-
https://library.vuforia.com/articles/Solution/How-To-Use-the-Vuforia-Web-Services-API#How-To-Add-a-Target for parameter details.
193+
https://library.vuforia.com/articles/Solution/How-To-Use-the-Vuforia-Web-Services-API#How-To-Add-a-Target
194+
for parameter details.
194195
195196
Args:
196197
name: The name of the target.
@@ -441,4 +442,4 @@ def get_duplicate_targets(self, target_id: str) -> List[str]:
441442
expected_result_code='Success',
442443
)
443444

444-
return response.json()['similar_targets']
445+
return list(response.json()['similar_targets'])

tests/test_vws.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def test_get_duplicate_targets(
291291
high_quality_image: io.BytesIO,
292292
) -> None:
293293
"""
294-
XXX
294+
It is possible to get the IDs of similar targets.
295295
"""
296296
target_id = client.add_target(
297297
name='x',
@@ -303,5 +303,8 @@ def test_get_duplicate_targets(
303303
width=1,
304304
image=high_quality_image,
305305
)
306+
307+
client.wait_for_target_processed(target_id=target_id)
308+
client.wait_for_target_processed(target_id=similar_target_id)
306309
duplicates = client.get_duplicate_targets(target_id=target_id)
307-
assert duplicates == []
310+
assert duplicates == [similar_target_id]

0 commit comments

Comments
 (0)