Skip to content

Commit 6b660e7

Browse files
committed
tests: fix test_verify_assert_msg by setting Accept-Encoding
Accept-Encoding is constructed dynamically by the availability of the compression libraries (eg. zstd, zstandard) so it can result failed test at the end. Fixes csernazs#345
1 parent 36807ec commit 6b660e7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/test_log_querying.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def test_verify(httpserver: HTTPServer):
3535
def test_verify_assert_msg(httpserver: HTTPServer):
3636
httpserver.no_handler_status_code = 404
3737
httpserver.expect_request("/foo", json={"foo": "bar"}, method="POST").respond_with_data("OK")
38-
assert requests.get(httpserver.url_for("/foo"), headers={"User-Agent": "requests"}).status_code == 404
38+
headers = {"User-Agent": "requests", "Accept-Encoding": "gzip, deflate"}
39+
assert requests.get(httpserver.url_for("/foo"), headers=headers).status_code == 404
3940

4041
with pytest.raises(AssertionError) as err:
4142
httpserver.assert_request_made(RequestMatcher("/foo", json={"foo": "bar"}, method="POST"))

0 commit comments

Comments
 (0)