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

Improve test compatibility with legacy httpbin index

Make the tests slightly more flexible to match both the flasgger-based
and legacy httpbin index.  This is needed for compatibility with
https://github.com/psf/httpbin/pull/44 when flasgger is not installed
(e.g. on architectures that are not supported by Rust).
This commit is contained in:
Michał Górny
2024-02-16 19:33:41 +01:00
parent 3ce5979acb
commit e60dafb8dc
2 changed files with 2 additions and 2 deletions

View File

@@ -39,7 +39,7 @@ def test_basic_json_use(tmpdir, httpbin):
test_fixture = str(tmpdir.join("synopsis.json")) test_fixture = str(tmpdir.join("synopsis.json"))
with vcr.use_cassette(test_fixture, serializer="json"): with vcr.use_cassette(test_fixture, serializer="json"):
response = urlopen(httpbin.url).read() response = urlopen(httpbin.url).read()
assert b"A simple HTTP Request & Response Service." in response assert b"HTTP Request & Response Service" in response
def test_patched_content(tmpdir, httpbin): def test_patched_content(tmpdir, httpbin):

View File

@@ -66,7 +66,7 @@ def test_load_cassette_with_custom_persister(tmpdir, httpbin):
with my_vcr.use_cassette(test_fixture, serializer="json"): with my_vcr.use_cassette(test_fixture, serializer="json"):
response = urlopen(httpbin.url).read() response = urlopen(httpbin.url).read()
assert b"A simple HTTP Request & Response Service." in response assert b"HTTP Request & Response Service" in response
def test_load_cassette_persister_exception_handling(tmpdir, httpbin): def test_load_cassette_persister_exception_handling(tmpdir, httpbin):