99from mock_vws import MockVWS
1010from mock_vws .database import VuforiaDatabase
1111
12- from vws import VWS , CloudRecoService
12+ from vws import VWS , CloudRecoIncludeTargetData , CloudRecoService
1313from vws .exceptions import MaxNumResultsOutOfRange
1414
1515
@@ -180,6 +180,9 @@ def test_default(
180180 cloud_reco_client : CloudRecoService ,
181181 high_quality_image : io .BytesIO ,
182182 ) -> None :
183+ """
184+ By default, target data is only returned in the top match.
185+ """
183186 target_id = vws_client .add_target (
184187 name = uuid .uuid4 ().hex ,
185188 width = 1 ,
@@ -205,6 +208,10 @@ def test_top(
205208 cloud_reco_client : CloudRecoService ,
206209 high_quality_image : io .BytesIO ,
207210 ) -> None :
211+ """
212+ When ``CloudRecoIncludeTargetData.TOP`` is given, target data is only
213+ returned in the top match.
214+ """
208215 target_id = vws_client .add_target (
209216 name = uuid .uuid4 ().hex ,
210217 width = 1 ,
@@ -220,6 +227,7 @@ def test_top(
220227 top_match , second_match = cloud_reco_client .query (
221228 image = high_quality_image ,
222229 max_num_results = 2 ,
230+ include_target_data = CloudRecoIncludeTargetData .TOP ,
223231 )
224232 assert 'target_data' in top_match
225233 assert 'target_data' not in second_match
@@ -230,6 +238,10 @@ def test_none(
230238 cloud_reco_client : CloudRecoService ,
231239 high_quality_image : io .BytesIO ,
232240 ) -> None :
241+ """
242+ When ``CloudRecoIncludeTargetData.NONE`` is given, target data is not
243+ returned in any match.
244+ """
233245 target_id = vws_client .add_target (
234246 name = uuid .uuid4 ().hex ,
235247 width = 1 ,
@@ -245,6 +257,7 @@ def test_none(
245257 top_match , second_match = cloud_reco_client .query (
246258 image = high_quality_image ,
247259 max_num_results = 2 ,
260+ include_target_data = CloudRecoIncludeTargetData .NONE ,
248261 )
249262 assert 'target_data' not in top_match
250263 assert 'target_data' not in second_match
@@ -255,6 +268,10 @@ def test_all(
255268 cloud_reco_client : CloudRecoService ,
256269 high_quality_image : io .BytesIO ,
257270 ) -> None :
271+ """
272+ When ``CloudRecoIncludeTargetData.ALL`` is given, target data is
273+ returned in all matches.
274+ """
258275 target_id = vws_client .add_target (
259276 name = uuid .uuid4 ().hex ,
260277 width = 1 ,
@@ -270,6 +287,7 @@ def test_all(
270287 top_match , second_match = cloud_reco_client .query (
271288 image = high_quality_image ,
272289 max_num_results = 2 ,
290+ include_target_data = CloudRecoIncludeTargetData .ALL ,
273291 )
274292 assert 'target_data' in top_match
275293 assert 'target_data' in second_match
0 commit comments