Skip to content

Commit 0bfa532

Browse files
committed
Passing test on real
1 parent 7b81946 commit 0bfa532

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

tests/mock_vws/test_query.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,8 +1079,25 @@ def test_png(
10791079
body=body,
10801080
)
10811081

1082-
assert_query_success(response=response)
1083-
assert response.json()['results'] == []
1082+
assert_vwq_failure(
1083+
response=response,
1084+
status_code=codes.UNPROCESSABLE_ENTITY,
1085+
content_type='application/json',
1086+
)
1087+
assert response.json().keys() == {'transaction_id', 'result_code'}
1088+
assert_valid_transaction_id(response=response)
1089+
assert_valid_date_header(response=response)
1090+
result_code = response.json()['result_code']
1091+
transaction_id = response.json()['transaction_id']
1092+
assert result_code == ResultCodes.BAD_IMAGE.value
1093+
# The separators are inconsistent and we test this.
1094+
expected_text = (
1095+
'{"transaction_id": '
1096+
f'"{transaction_id}",'
1097+
f'"result_code":"{result_code}"'
1098+
'}'
1099+
)
1100+
assert response.text == expected_text
10841101

10851102
def test_jpeg(self) -> None:
10861103
"""

0 commit comments

Comments
 (0)