66from __future__ import annotations
77
88import uuid
9+ from enum import Enum , auto
910from typing import TYPE_CHECKING
1011
1112import pytest
@@ -140,13 +141,19 @@ def test_target_quality(
140141 """
141142 The target tracking rating is as expected.
142143 """
144+
145+ class TrackingRating (Enum ):
146+ ZERO = auto ()
147+ NEGATIVE = auto ()
148+ POSITIVE = auto ()
149+
143150 target_id_expected_rating_pairs = []
144151 for image_file in (
145152 high_quality_image ,
146153 image_file_failed_state ,
147- image_file_success_state_low_rating ,
154+ # image_file_success_state_low_rating,
148155 corrupted_image_file ,
149- different_high_quality_image ,
156+ # different_high_quality_image,
150157 ):
151158 target_id = vws_client .add_target (
152159 name = f"example_{ uuid .uuid4 ().hex } " ,
@@ -157,11 +164,11 @@ def test_target_quality(
157164 )
158165
159166 expected_tracking_rating = {
160- high_quality_image : 5 ,
161- image_file_failed_state : 0 ,
162- image_file_success_state_low_rating : 0 ,
163- corrupted_image_file : - 2 ,
164- different_high_quality_image : 0 ,
167+ high_quality_image : TrackingRating . POSITIVE ,
168+ image_file_failed_state : TrackingRating . ZERO ,
169+ image_file_success_state_low_rating : TrackingRating . ZERO ,
170+ corrupted_image_file : TrackingRating . NEGATIVE ,
171+ different_high_quality_image : TrackingRating . ZERO ,
165172 }[image_file ]
166173 target_id_expected_rating_pairs .append (
167174 (target_id , expected_tracking_rating ),
@@ -174,10 +181,12 @@ def test_target_quality(
174181 vws_client .wait_for_target_processed (target_id = target_id )
175182
176183 target_details = vws_client .get_target_record (target_id = target_id )
177- assert (
178- target_details .target_record .tracking_rating
179- == expected_tracking_rating
180- )
184+ if expected_tracking_rating == TrackingRating .ZERO :
185+ assert target_details .target_record .tracking_rating == 0
186+ elif expected_tracking_rating == TrackingRating .NEGATIVE :
187+ assert target_details .target_record .tracking_rating < 0
188+ else :
189+ assert target_details .target_record .tracking_rating > 0
181190
182191
183192@pytest .mark .usefixtures ("verify_mock_vuforia" )
0 commit comments