File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed
Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -249,7 +249,9 @@ def test_name_invalid(
249249 vuforia_database_keys : VuforiaDatabaseKeys ,
250250 ) -> None :
251251 """
252- A target's name must be a string of length 0 < N < 65.
252+ A target's name must be a UTF-8 encoded string of length 0 < N < 65.
253+
254+ We test bad encoding in another test as it has a different error.
253255 """
254256 image_data = png_rgb .read ()
255257 image_data_encoded = base64 .b64encode (image_data ).decode ('ascii' )
@@ -271,6 +273,33 @@ def test_name_invalid(
271273 result_code = ResultCodes .FAIL ,
272274 )
273275
276+ # TODO also on update
277+ def test_not_utf8_encoded (
278+ self ,
279+ png_rgb : io .BytesIO ,
280+ vuforia_database_keys : VuforiaDatabaseKeys ,
281+ ) -> None :
282+ name = '\U0001f604 '
283+ image_data = png_rgb .read ()
284+ image_data_encoded = base64 .b64encode (image_data ).decode ('ascii' )
285+
286+ data = {
287+ 'name' : name ,
288+ 'width' : 1 ,
289+ 'image' : image_data_encoded ,
290+ }
291+
292+ response = add_target_to_vws (
293+ vuforia_database_keys = vuforia_database_keys ,
294+ data = data ,
295+ )
296+
297+ assert_vws_failure (
298+ response = response ,
299+ status_code = codes .INTERNAL_SERVER_ERROR ,
300+ result_code = ResultCodes .FAIL ,
301+ )
302+
274303 def test_existing_target_name (
275304 self ,
276305 png_rgb : io .BytesIO ,
You can’t perform that action at this time.
0 commit comments