Skip to content

Commit f02bddd

Browse files
committed
Remove one more use of a custom helper
1 parent 766d9a2 commit f02bddd

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

tests/mock_vws/test_add_target.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -984,31 +984,25 @@ def test_not_base64_encoded_processable(
984984

985985
@staticmethod
986986
def test_not_base64_encoded_not_processable(
987-
vuforia_database: VuforiaDatabase,
988987
high_quality_image: io.BytesIO,
989988
not_base64_encoded_not_processable: str,
989+
vws_client: VWS,
990990
) -> None:
991991
"""
992992
Some strings which are not valid base64 encoded strings are not allowed
993993
as application metadata.
994994
"""
995-
image_content = high_quality_image.getvalue()
996-
image_data_encoded = base64.b64encode(s=image_content).decode("ascii")
997-
998-
data = {
999-
"name": "example_name",
1000-
"width": 1,
1001-
"image": image_data_encoded,
1002-
"application_metadata": not_base64_encoded_not_processable,
1003-
}
1004-
1005-
response = _add_target_to_vws(
1006-
vuforia_database=vuforia_database,
1007-
data=data,
1008-
)
995+
with pytest.raises(expected_exception=Fail) as exc:
996+
vws_client.add_target(
997+
name="example",
998+
width=1,
999+
image=high_quality_image,
1000+
application_metadata=not_base64_encoded_not_processable,
1001+
active_flag=True,
1002+
)
10091003

10101004
assert_vws_failure(
1011-
response=response,
1005+
response=exc.value.response,
10121006
status_code=HTTPStatus.UNPROCESSABLE_ENTITY,
10131007
result_code=ResultCodes.FAIL,
10141008
)

0 commit comments

Comments
 (0)