1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 01:03:24 +00:00

pre-commit: Mass-apply trailing-whitespace

This commit is contained in:
Sebastian Pipping
2023-12-12 18:56:19 +01:00
parent 962284072b
commit 1dd9cbde8b
7 changed files with 28 additions and 28 deletions

View File

@@ -14,7 +14,7 @@ jobs:
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
with: with:
python-version: "3.12" python-version: "3.12"
- name: Install build dependencies - name: Install build dependencies
run: pip install -r docs/requirements.txt run: pip install -r docs/requirements.txt
- name: Rendering HTML documentation - name: Rendering HTML documentation

View File

@@ -16,7 +16,7 @@ a nice addition. Here's an example:
with vcr.use_cassette('fixtures/vcr_cassettes/synopsis.yaml') as cass: with vcr.use_cassette('fixtures/vcr_cassettes/synopsis.yaml') as cass:
response = urllib2.urlopen('http://www.zombo.com/').read() response = urllib2.urlopen('http://www.zombo.com/').read()
# cass should have 1 request inside it # cass should have 1 request inside it
assert len(cass) == 1 assert len(cass) == 1
# the request uri should have been http://www.zombo.com/ # the request uri should have been http://www.zombo.com/
assert cass.requests[0].uri == 'http://www.zombo.com/' assert cass.requests[0].uri == 'http://www.zombo.com/'
@@ -208,7 +208,7 @@ So these two calls are the same:
# original (still works) # original (still works)
vcr = VCR(filter_headers=['authorization']) vcr = VCR(filter_headers=['authorization'])
# new # new
vcr = VCR(filter_headers=[('authorization', None)]) vcr = VCR(filter_headers=[('authorization', None)])
@@ -218,7 +218,7 @@ Here are two examples of the new functionality:
# replace with a static value (most common) # replace with a static value (most common)
vcr = VCR(filter_headers=[('authorization', 'XXXXXX')]) vcr = VCR(filter_headers=[('authorization', 'XXXXXX')])
# replace with a callable, for example when testing # replace with a callable, for example when testing
# lots of different kinds of authorization. # lots of different kinds of authorization.
def replace_auth(key, value, request): def replace_auth(key, value, request):
@@ -286,7 +286,7 @@ sensitive data from the response body:
before_record_response=scrub_string(settings.USERNAME, 'username'), before_record_response=scrub_string(settings.USERNAME, 'username'),
) )
with my_vcr.use_cassette('test.yml'): with my_vcr.use_cassette('test.yml'):
# your http code here # your http code here
Decode compressed response Decode compressed response

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# https://blog.ionelmc.ro/2015/04/14/tox-tricks-and-patterns/#when-it-inevitably-leads-to-shell-scripts # https://blog.ionelmc.ro/2015/04/14/tox-tricks-and-patterns/#when-it-inevitably-leads-to-shell-scripts
# If you are getting an INVOCATION ERROR for this script then there is # If you are getting an INVOCATION ERROR for this script then there is
# a good chance you are running on Windows. # a good chance you are running on Windows.
# You can and should use WSL for running tox on Windows when it calls bash scripts. # You can and should use WSL for running tox on Windows when it calls bash scripts.
REQUESTS_CA_BUNDLE=`python3 -m pytest_httpbin.certs` exec pytest "$@" REQUESTS_CA_BUNDLE=`python3 -m pytest_httpbin.certs` exec pytest "$@"

View File

@@ -15,9 +15,9 @@
}, },
"response": { "response": {
"status": { "status": {
"message": "OK", "message": "OK",
"code": 200 "code": 200
}, },
"headers": { "headers": {
"access-control-allow-origin": ["*"], "access-control-allow-origin": ["*"],
"content-type": ["application/json"], "content-type": ["application/json"],
@@ -25,7 +25,7 @@
"server": ["gunicorn/0.17.4"], "server": ["gunicorn/0.17.4"],
"content-length": ["32"], "content-length": ["32"],
"connection": ["keep-alive"] "connection": ["keep-alive"]
}, },
"body": { "body": {
"string": "{\n \"origin\": \"217.122.164.194\"\n}" "string": "{\n \"origin\": \"217.122.164.194\"\n}"
} }

View File

@@ -2,7 +2,7 @@ version: 1
interactions: interactions:
- request: - request:
body: null body: null
headers: headers:
accept: ['*/*'] accept: ['*/*']
accept-encoding: ['gzip, deflate, compress'] accept-encoding: ['gzip, deflate, compress']
user-agent: ['python-requests/2.2.1 CPython/2.6.1 Darwin/10.8.0'] user-agent: ['python-requests/2.2.1 CPython/2.6.1 Darwin/10.8.0']

View File

@@ -1,31 +1,31 @@
[ [
{ {
"request": { "request": {
"body": null, "body": null,
"protocol": "http", "protocol": "http",
"method": "GET", "method": "GET",
"headers": { "headers": {
"accept-encoding": "gzip, deflate, compress", "accept-encoding": "gzip, deflate, compress",
"accept": "*/*", "accept": "*/*",
"user-agent": "python-requests/2.2.1 CPython/2.6.1 Darwin/10.8.0" "user-agent": "python-requests/2.2.1 CPython/2.6.1 Darwin/10.8.0"
}, },
"host": "httpbin.org", "host": "httpbin.org",
"path": "/ip", "path": "/ip",
"port": 80 "port": 80
}, },
"response": { "response": {
"status": { "status": {
"message": "OK", "message": "OK",
"code": 200 "code": 200
}, },
"headers": [ "headers": [
"access-control-allow-origin: *\r\n", "access-control-allow-origin: *\r\n",
"content-type: application/json\r\n", "content-type: application/json\r\n",
"date: Mon, 21 Apr 2014 23:13:40 GMT\r\n", "date: Mon, 21 Apr 2014 23:13:40 GMT\r\n",
"server: gunicorn/0.17.4\r\n", "server: gunicorn/0.17.4\r\n",
"content-length: 32\r\n", "content-length: 32\r\n",
"connection: keep-alive\r\n" "connection: keep-alive\r\n"
], ],
"body": { "body": {
"string": "{\n \"origin\": \"217.122.164.194\"\n}" "string": "{\n \"origin\": \"217.122.164.194\"\n}"
} }

View File

@@ -10,7 +10,7 @@ interactions:
uri: http://seomoz.org/ uri: http://seomoz.org/
response: response:
body: {string: ''} body: {string: ''}
headers: headers:
Location: ['http://moz.com/'] Location: ['http://moz.com/']
Server: ['BigIP'] Server: ['BigIP']
Connection: ['Keep-Alive'] Connection: ['Keep-Alive']