-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Use JSON serializer for VCR, instead of ignoring ImportWarning
- Loading branch information
1 parent
d0f17f4
commit 9676f1c
Showing
4 changed files
with
124 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,58 @@ | ||
interactions: | ||
- request: | ||
body: null | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
User-Agent: | ||
- python-requests/2.23.0 | ||
method: GET | ||
uri: http://httpbin.org/status/400 | ||
response: | ||
body: | ||
string: '' | ||
headers: | ||
Access-Control-Allow-Credentials: | ||
- 'true' | ||
Access-Control-Allow-Origin: | ||
- '*' | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '0' | ||
Content-Type: | ||
- text/html; charset=utf-8 | ||
Date: | ||
- Sun, 15 Mar 2020 20:45:10 GMT | ||
Server: | ||
- gunicorn/19.9.0 | ||
status: | ||
code: 400 | ||
message: BAD REQUEST | ||
version: 1 | ||
{ | ||
"version": 1, | ||
"interactions": [ | ||
{ | ||
"request": { | ||
"method": "GET", | ||
"uri": "http://httpbin.org/status/400", | ||
"body": null, | ||
"headers": { | ||
"User-Agent": [ | ||
"python-requests/2.27.1" | ||
], | ||
"Accept-Encoding": [ | ||
"gzip, deflate" | ||
], | ||
"Accept": [ | ||
"*/*" | ||
], | ||
"Connection": [ | ||
"keep-alive" | ||
] | ||
} | ||
}, | ||
"response": { | ||
"status": { | ||
"code": 400, | ||
"message": "BAD REQUEST" | ||
}, | ||
"headers": { | ||
"Date": [ | ||
"Wed, 06 Apr 2022 15:44:05 GMT" | ||
], | ||
"Access-Control-Allow-Credentials": [ | ||
"true" | ||
], | ||
"Server": [ | ||
"gunicorn/19.9.0" | ||
], | ||
"Connection": [ | ||
"keep-alive" | ||
], | ||
"Content-Type": [ | ||
"text/html; charset=utf-8" | ||
], | ||
"Content-Length": [ | ||
"0" | ||
], | ||
"Access-Control-Allow-Origin": [ | ||
"*" | ||
] | ||
}, | ||
"body": { | ||
"string": "" | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,58 @@ | ||
interactions: | ||
- request: | ||
body: null | ||
headers: | ||
Accept: | ||
- '*/*' | ||
Accept-Encoding: | ||
- gzip, deflate | ||
Connection: | ||
- keep-alive | ||
User-Agent: | ||
- python-requests/2.23.0 | ||
method: HEAD | ||
uri: http://httpbin.org/status/400 | ||
response: | ||
body: | ||
string: '' | ||
headers: | ||
Access-Control-Allow-Credentials: | ||
- 'true' | ||
Access-Control-Allow-Origin: | ||
- '*' | ||
Connection: | ||
- keep-alive | ||
Content-Length: | ||
- '0' | ||
Content-Type: | ||
- text/html; charset=utf-8 | ||
Date: | ||
- Sun, 15 Mar 2020 20:45:10 GMT | ||
Server: | ||
- gunicorn/19.9.0 | ||
status: | ||
code: 400 | ||
message: BAD REQUEST | ||
version: 1 | ||
{ | ||
"version": 1, | ||
"interactions": [ | ||
{ | ||
"request": { | ||
"method": "HEAD", | ||
"uri": "http://httpbin.org/status/400", | ||
"body": null, | ||
"headers": { | ||
"User-Agent": [ | ||
"python-requests/2.27.1" | ||
], | ||
"Accept-Encoding": [ | ||
"gzip, deflate" | ||
], | ||
"Accept": [ | ||
"*/*" | ||
], | ||
"Connection": [ | ||
"keep-alive" | ||
] | ||
} | ||
}, | ||
"response": { | ||
"status": { | ||
"code": 400, | ||
"message": "BAD REQUEST" | ||
}, | ||
"headers": { | ||
"Date": [ | ||
"Wed, 06 Apr 2022 15:44:04 GMT" | ||
], | ||
"Access-Control-Allow-Credentials": [ | ||
"true" | ||
], | ||
"Server": [ | ||
"gunicorn/19.9.0" | ||
], | ||
"Connection": [ | ||
"keep-alive" | ||
], | ||
"Content-Type": [ | ||
"text/html; charset=utf-8" | ||
], | ||
"Content-Length": [ | ||
"0" | ||
], | ||
"Access-Control-Allow-Origin": [ | ||
"*" | ||
] | ||
}, | ||
"body": { | ||
"string": "" | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import pytest | ||
|
||
|
||
@pytest.fixture(scope='module') | ||
def vcr_config(): | ||
# Avoid ImportWarning from YAML on PyPy 3.7. https://github.com/yaml/pyyaml/issues/534 | ||
return {'serializer': 'json'} |