Skip to content

Commit ef81a9b

Browse files
committed
Progress
1 parent fddee74 commit ef81a9b

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

tests/test_query.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class TestQuery:
1212
Tests for adding a target.
1313
"""
1414

15-
def test_query(
15+
def test_no_matches(
1616
self,
1717
cloud_reco_client: CloudRecoService,
1818
high_quality_image: io.BytesIO,
@@ -23,11 +23,28 @@ def test_query(
2323
result = cloud_reco_client.query(image=high_quality_image)
2424
assert result == []
2525

26+
def test_match(
27+
self,
28+
client: VWS,
29+
cloud_reco_client: CloudRecoService,
30+
high_quality_image: io.BytesIO,
31+
) -> None:
32+
"""
33+
XXX
34+
"""
35+
target_id = client.add_target(
36+
name='x',
37+
width=1,
38+
image=high_quality_image,
39+
)
40+
client.wait_for_target_processed(target_id=target_id)
41+
[matching_target] = cloud_reco_client.query(image=high_quality_image)
42+
assert matching_target['target_id'] == target_id
43+
2644

2745
# TODO test custom base URL
2846
# TODO test bad credentials
29-
# TODO test no results
30-
# TODO test some results
47+
# TODO test options - max_num_results + include_target_data
3148

3249
# TODO do we give an image type? Infer it?
3350
# What happens if we just always give jpeg?

0 commit comments

Comments
 (0)