diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2faf9a7..f0b51b6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.12" - + - name: Install build dependencies run: pip install -r docs/requirements.txt - name: Rendering HTML documentation diff --git a/docs/advanced.rst b/docs/advanced.rst index 65b3d4b..118570f 100644 --- a/docs/advanced.rst +++ b/docs/advanced.rst @@ -16,7 +16,7 @@ a nice addition. Here's an example: with vcr.use_cassette('fixtures/vcr_cassettes/synopsis.yaml') as cass: response = urllib2.urlopen('http://www.zombo.com/').read() # 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/ assert cass.requests[0].uri == 'http://www.zombo.com/' @@ -208,7 +208,7 @@ So these two calls are the same: # original (still works) vcr = VCR(filter_headers=['authorization']) - + # new 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) vcr = VCR(filter_headers=[('authorization', 'XXXXXX')]) - + # replace with a callable, for example when testing # lots of different kinds of authorization. def replace_auth(key, value, request): @@ -286,7 +286,7 @@ sensitive data from the response body: before_record_response=scrub_string(settings.USERNAME, 'username'), ) with my_vcr.use_cassette('test.yml'): - # your http code here + # your http code here Decode compressed response diff --git a/runtests.sh b/runtests.sh index f219725..9e40a2d 100755 --- a/runtests.sh +++ b/runtests.sh @@ -1,7 +1,7 @@ #!/bin/bash # 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. # 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 "$@" diff --git a/tests/fixtures/migration/new_cassette.json b/tests/fixtures/migration/new_cassette.json index 5526989..822fa2a 100644 --- a/tests/fixtures/migration/new_cassette.json +++ b/tests/fixtures/migration/new_cassette.json @@ -15,9 +15,9 @@ }, "response": { "status": { - "message": "OK", + "message": "OK", "code": 200 - }, + }, "headers": { "access-control-allow-origin": ["*"], "content-type": ["application/json"], @@ -25,7 +25,7 @@ "server": ["gunicorn/0.17.4"], "content-length": ["32"], "connection": ["keep-alive"] - }, + }, "body": { "string": "{\n \"origin\": \"217.122.164.194\"\n}" } diff --git a/tests/fixtures/migration/new_cassette.yaml b/tests/fixtures/migration/new_cassette.yaml index e319dc8..b30652f 100644 --- a/tests/fixtures/migration/new_cassette.yaml +++ b/tests/fixtures/migration/new_cassette.yaml @@ -2,7 +2,7 @@ version: 1 interactions: - request: body: null - headers: + headers: accept: ['*/*'] accept-encoding: ['gzip, deflate, compress'] user-agent: ['python-requests/2.2.1 CPython/2.6.1 Darwin/10.8.0'] diff --git a/tests/fixtures/migration/old_cassette.json b/tests/fixtures/migration/old_cassette.json index f6bfed1..7c4ff68 100644 --- a/tests/fixtures/migration/old_cassette.json +++ b/tests/fixtures/migration/old_cassette.json @@ -1,31 +1,31 @@ [ { "request": { - "body": null, - "protocol": "http", - "method": "GET", + "body": null, + "protocol": "http", + "method": "GET", "headers": { - "accept-encoding": "gzip, deflate, compress", - "accept": "*/*", + "accept-encoding": "gzip, deflate, compress", + "accept": "*/*", "user-agent": "python-requests/2.2.1 CPython/2.6.1 Darwin/10.8.0" - }, - "host": "httpbin.org", - "path": "/ip", + }, + "host": "httpbin.org", + "path": "/ip", "port": 80 - }, + }, "response": { "status": { - "message": "OK", + "message": "OK", "code": 200 - }, + }, "headers": [ - "access-control-allow-origin: *\r\n", - "content-type: application/json\r\n", - "date: Mon, 21 Apr 2014 23:13:40 GMT\r\n", - "server: gunicorn/0.17.4\r\n", - "content-length: 32\r\n", + "access-control-allow-origin: *\r\n", + "content-type: application/json\r\n", + "date: Mon, 21 Apr 2014 23:13:40 GMT\r\n", + "server: gunicorn/0.17.4\r\n", + "content-length: 32\r\n", "connection: keep-alive\r\n" - ], + ], "body": { "string": "{\n \"origin\": \"217.122.164.194\"\n}" } diff --git a/tests/fixtures/wild/domain_redirect.yaml b/tests/fixtures/wild/domain_redirect.yaml index 618babc..5df9210 100644 --- a/tests/fixtures/wild/domain_redirect.yaml +++ b/tests/fixtures/wild/domain_redirect.yaml @@ -10,7 +10,7 @@ interactions: uri: http://seomoz.org/ response: body: {string: ''} - headers: + headers: Location: ['http://moz.com/'] Server: ['BigIP'] Connection: ['Keep-Alive']