File tree Expand file tree Collapse file tree 2 files changed +36
-5
lines changed
Expand file tree Collapse file tree 2 files changed +36
-5
lines changed Original file line number Diff line number Diff line change @@ -412,17 +412,19 @@ def delete_target(self, target_id: str) -> None:
412412 expected_result_code = 'Success' ,
413413 )
414414
415- def get_duplicate_targets (self , target_id : str ) -> None :
415+ def get_duplicate_targets (self , target_id : str ) -> List [ str ] :
416416 """
417417 Get targets which may be considered duplicates of a given target.
418418
419419 See
420420 https://library.vuforia.com/articles/Solution/How-To-Use-the-Vuforia-Web-Services-API.html#How-To-Check-for-Duplicate-Targets.
421421
422-
423422 Args:
424423 target_id: The ID of the target to delete.
425424
425+ Returns:
426+ The target IDs of duplicate targets.
427+
426428 Raises:
427429 ~vws.exceptions.AuthenticationFailure: The secret key is not
428430 correct.
@@ -432,9 +434,11 @@ def get_duplicate_targets(self, target_id: str) -> None:
432434 target in the database.
433435 ~vws.exceptions.ProjectInactive: The project is inactive.
434436 """
435- self ._make_request (
436- method = 'DELETE ' ,
437+ response = self ._make_request (
438+ method = 'GET ' ,
437439 content = b'' ,
438- request_path = f'/targets /{ target_id } ' ,
440+ request_path = f'/duplicates /{ target_id } ' ,
439441 expected_result_code = 'Success' ,
440442 )
443+
444+ return response .json ()['similar_targets' ]
Original file line number Diff line number Diff line change @@ -278,3 +278,30 @@ def test_wait_for_target_processed(
278278 client .wait_for_target_processed (target_id = target_id )
279279 report = client .get_target_summary_report (target_id = target_id )
280280 assert report ['status' ] != 'processing'
281+
282+
283+ class TestGetDuplicateTargets :
284+ """
285+ Tests for getting duplicate targets.
286+ """
287+
288+ def test_get_duplicate_targets (
289+ self ,
290+ client : VWS ,
291+ high_quality_image : io .BytesIO ,
292+ ) -> None :
293+ """
294+ XXX
295+ """
296+ target_id = client .add_target (
297+ name = 'x' ,
298+ width = 1 ,
299+ image = high_quality_image ,
300+ )
301+ similar_target_id = client .add_target (
302+ name = 'a' ,
303+ width = 1 ,
304+ image = high_quality_image ,
305+ )
306+ duplicates = client .get_duplicate_targets (target_id = target_id )
307+ assert duplicates == []
You can’t perform that action at this time.
0 commit comments