Skip to content

Commit 533141a

Browse files
committed
Progress
1 parent 334b121 commit 533141a

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

src/vws/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def query(
4040
image_content = image.getvalue()
4141
body = {
4242
'image': ('image.jpeg', image_content, 'image/jpeg'),
43-
'max_num_results': (None, max_num_results, 'text/plain'),
43+
'max_num_results': (None, int(max_num_results), 'text/plain'),
4444
}
4545
date = rfc_1123_date()
4646
request_path = '/v1/query'

tests/test_query.py

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99,27 +99,23 @@ def test_custom(
9999
client.wait_for_target_processed(target_id=target_id)
100100
client.wait_for_target_processed(target_id=target_id_2)
101101
client.wait_for_target_processed(target_id=target_id_3)
102-
matches = cloud_reco_client.query(image=high_quality_image, max_num_results=2)
102+
matches = cloud_reco_client.query(
103+
image=high_quality_image,
104+
max_num_results=2,
105+
)
103106
assert len(matches) == 2
104107

105108

106109

107-
def test_foo(self):
108-
pass
109-
# target_ids = set([])
110-
# for i in range(15):
111-
# target_id = client.add_target(
112-
# name=uuid.uuid4().hex,
113-
# width=1,
114-
# image=high_quality_image,
115-
# )
116-
# target_ids.add(target_id)
117-
#
118-
# for target_id in target_ids:
119-
# client.wait_for_target_processed(target_id=target_id)
120-
#
121-
# matching_targets = cloud_reco_client.query(image=high_quality_image)
122-
# assert len(matching_targets) == 1
110+
def test_too_many(
111+
self,
112+
cloud_reco_client: CloudRecoService,
113+
high_quality_image: io.BytesIO,
114+
) -> None:
115+
matches = cloud_reco_client.query(
116+
image=high_quality_image,
117+
max_num_results=51,
118+
)
123119

124120

125121
# TODO test custom base URL

0 commit comments

Comments
 (0)