@@ -167,3 +167,101 @@ def test_too_many(
167167 'Accepted range is from 1 to 50 (inclusive).'
168168 )
169169 assert str (exc .value ) == exc .value .response .text == expected_value
170+
171+
172+ class TestIncludeTargetData :
173+ """
174+ Tests for the ``include_target_data`` parameter of ``query``.
175+ """
176+
177+ def test_default (
178+ self ,
179+ vws_client : VWS ,
180+ cloud_reco_client : CloudRecoService ,
181+ high_quality_image : io .BytesIO ,
182+ ) -> None :
183+ target_id = vws_client .add_target (
184+ name = uuid .uuid4 ().hex ,
185+ width = 1 ,
186+ image = high_quality_image ,
187+ )
188+ target_id_2 = vws_client .add_target (
189+ name = uuid .uuid4 ().hex ,
190+ width = 1 ,
191+ image = high_quality_image ,
192+ )
193+ vws_client .wait_for_target_processed (target_id = target_id )
194+ vws_client .wait_for_target_processed (target_id = target_id_2 )
195+ top_match , second_match = cloud_reco_client .query (
196+ image = high_quality_image ,
197+ max_num_results = 2 ,
198+ )
199+
200+ def test_top (
201+ self ,
202+ vws_client : VWS ,
203+ cloud_reco_client : CloudRecoService ,
204+ high_quality_image : io .BytesIO ,
205+ ) -> None :
206+ target_id = vws_client .add_target (
207+ name = uuid .uuid4 ().hex ,
208+ width = 1 ,
209+ image = high_quality_image ,
210+ )
211+ target_id_2 = vws_client .add_target (
212+ name = uuid .uuid4 ().hex ,
213+ width = 1 ,
214+ image = high_quality_image ,
215+ )
216+ vws_client .wait_for_target_processed (target_id = target_id )
217+ vws_client .wait_for_target_processed (target_id = target_id_2 )
218+ top_match , second_match = cloud_reco_client .query (
219+ image = high_quality_image ,
220+ max_num_results = 2 ,
221+ )
222+
223+ def test_none (
224+ self ,
225+ vws_client : VWS ,
226+ cloud_reco_client : CloudRecoService ,
227+ high_quality_image : io .BytesIO ,
228+ ) -> None :
229+ target_id = vws_client .add_target (
230+ name = uuid .uuid4 ().hex ,
231+ width = 1 ,
232+ image = high_quality_image ,
233+ )
234+ target_id_2 = vws_client .add_target (
235+ name = uuid .uuid4 ().hex ,
236+ width = 1 ,
237+ image = high_quality_image ,
238+ )
239+ vws_client .wait_for_target_processed (target_id = target_id )
240+ vws_client .wait_for_target_processed (target_id = target_id_2 )
241+ top_match , second_match = cloud_reco_client .query (
242+ image = high_quality_image ,
243+ max_num_results = 2 ,
244+ )
245+
246+ def test_all (
247+ self ,
248+ vws_client : VWS ,
249+ cloud_reco_client : CloudRecoService ,
250+ high_quality_image : io .BytesIO ,
251+ ) -> None :
252+ target_id = vws_client .add_target (
253+ name = uuid .uuid4 ().hex ,
254+ width = 1 ,
255+ image = high_quality_image ,
256+ )
257+ target_id_2 = vws_client .add_target (
258+ name = uuid .uuid4 ().hex ,
259+ width = 1 ,
260+ image = high_quality_image ,
261+ )
262+ vws_client .wait_for_target_processed (target_id = target_id )
263+ vws_client .wait_for_target_processed (target_id = target_id_2 )
264+ top_match , second_match = cloud_reco_client .query (
265+ image = high_quality_image ,
266+ max_num_results = 2 ,
267+ )
0 commit comments