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

Use primitive types when recording cassettes using aiohttp stub (#454)

This commit is contained in:
Luiz Menezes
2019-07-04 21:52:08 -03:00
committed by Josh Peak
parent b92be4e9e5
commit bbab27ed1b
2 changed files with 4 additions and 2 deletions

View File

@@ -56,6 +56,8 @@ def test_headers(tmpdir, scheme):
cassette_response, _ = get(url)
assert cassette_response.headers == response.headers
assert cassette.play_count == 1
assert 'istr' not in cassette.data[0]
assert 'yarl.URL' not in cassette.data[0]
def test_text(tmpdir, scheme):

View File

@@ -98,9 +98,9 @@ def vcr_request(cassette, real_request):
'code': response.status,
'message': response.reason,
},
'headers': dict(response.headers),
'headers': {str(key): value for key, value in response.headers.items()},
'body': {'string': (await response.read())}, # NOQA: E999
'url': response.url,
'url': str(response.url),
}
cassette.append(vcr_request, vcr_response)