Skip to content

Commit 3eac4ac

Browse files
committed
Start of a test for metadata too large
1 parent fd79135 commit 3eac4ac

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tests/mock_vws/test_add_target.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,3 +767,32 @@ def test_not_base64_encoded(
767767
status_code=codes.UNPROCESSABLE_ENTITY,
768768
result_code=ResultCodes.FAIL,
769769
)
770+
771+
def test_too_large_foo(
772+
self,
773+
vuforia_database_keys: VuforiaDatabaseKeys,
774+
png_rgb: io.BytesIO,
775+
) -> None:
776+
"""
777+
A base64 encoded string is valid application metadata.
778+
"""
779+
image_data = png_rgb.read()
780+
image_data_encoded = base64.b64encode(image_data).decode('ascii')
781+
782+
# 10000 not too small
783+
metadata = b'a' * 100000
784+
metadata_encoded = base64.b64encode(metadata).decode('ascii')
785+
786+
data = {
787+
'name': 'example_name',
788+
'width': 1,
789+
'image': image_data_encoded,
790+
'application_metadata': metadata_encoded,
791+
}
792+
793+
response = add_target_to_vws(
794+
vuforia_database_keys=vuforia_database_keys,
795+
data=data,
796+
)
797+
798+
assert_success(response=response)

0 commit comments

Comments
 (0)