@@ -203,13 +203,16 @@ class TestTargetName:
203203 Tests for the target name field.
204204 """
205205
206+ _MAX_CHAR_VALUE = 65535
207+
206208 @pytest .mark .parametrize (
207209 'name' ,
208210 [
209211 'á' ,
212+ chr (_MAX_CHAR_VALUE ),
210213 'a' * 64 ,
211214 ],
212- ids = ['Short name' , 'Long name' ],
215+ ids = ['Short name' , 'Max char value' , ' Long name' ],
213216 )
214217 def test_name_valid (
215218 self ,
@@ -249,9 +252,10 @@ def test_name_invalid(
249252 vuforia_database_keys : VuforiaDatabaseKeys ,
250253 ) -> None :
251254 """
252- A target's name must be a UTF-8 encoded string of length 0 < N < 65.
255+ A target's name must be a string of length 0 < N < 65.
253256
254- We test bad encoding in another test as it has a different error.
257+ We test characters out of range in another test as that gives a
258+ different error.
255259 """
256260 image_data = png_rgb .read ()
257261 image_data_encoded = base64 .b64encode (image_data ).decode ('ascii' )
@@ -273,13 +277,12 @@ def test_name_invalid(
273277 result_code = ResultCodes .FAIL ,
274278 )
275279
276- # TODO also on update
277- def test_not_utf8_encoded (
280+ def test_character_out_of_range (
278281 self ,
279282 png_rgb : io .BytesIO ,
280283 vuforia_database_keys : VuforiaDatabaseKeys ,
281284 ) -> None :
282- name = ' \U0001f604 '
285+ name = chr ( self . _MAX_CHAR_VALUE + 1 )
283286 image_data = png_rgb .read ()
284287 image_data_encoded = base64 .b64encode (image_data ).decode ('ascii' )
285288
0 commit comments