1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00

aiohttp headers are case insensitive (#461)

* aiohttp headers are case insensitive

* flakes
This commit is contained in:
Laurent Mazuel
2019-07-30 16:17:54 -07:00
committed by Josh Peak
parent 9d37210fc8
commit e3b7116564
2 changed files with 15 additions and 2 deletions

View File

@@ -59,12 +59,24 @@ def test_headers(tmpdir, scheme, auth):
request = cassette.requests[0]
assert "AUTHORIZATION" in request.headers
cassette_response, _ = get(url, auth=auth)
assert cassette_response.headers == response.headers
assert dict(cassette_response.headers) == dict(response.headers)
assert cassette.play_count == 1
assert 'istr' not in cassette.data[0]
assert 'yarl.URL' not in cassette.data[0]
def test_case_insensitive_headers(tmpdir, scheme):
url = scheme + '://httpbin.org'
with vcr.use_cassette(str(tmpdir.join('whatever.yaml'))):
_, _ = get(url)
with vcr.use_cassette(str(tmpdir.join('whatever.yaml'))) as cassette:
cassette_response, _ = get(url)
assert "Content-Type" in cassette_response.headers
assert "content-type" in cassette_response.headers
assert cassette.play_count == 1
def test_text(tmpdir, scheme):
url = scheme + '://httpbin.org'
with vcr.use_cassette(str(tmpdir.join('text.yaml'))):