From 6e42f243be47783a3253666aa5f7f5436b876b7b Mon Sep 17 00:00:00 2001 From: Giorgio Salluzzo Date: Sat, 17 Dec 2022 15:12:44 +0100 Subject: [PATCH] Replacing httpbin.org with httpbin.local backed by Docker Compose. --- .github/workflows/main.yml | 26 +++++----- Makefile | 13 +++-- Pipfile | 2 + docker-compose.yml | 15 ++++++ mocket/mocket.py | 2 +- tests/main/test_http.py | 32 ++++++------ tests/main/test_http_aiohttp.py | 6 +-- tests/main/test_http_with_xxhash.py | 15 +++--- tests/main/test_httpretty.py | 49 ++++++++++++++----- tests/main/test_https.py | 10 ++-- tests/main/test_mode.py | 4 +- ..._truesendall_with_dump_from_recording.json | 24 ++++----- ..._truesendall_with_dump_from_recording.json | 14 +++--- ..._truesendall_with_dump_from_recording.json | 24 ++++----- tests/tests38/test_http_aiohttp.py | 6 +-- 15 files changed, 146 insertions(+), 96 deletions(-) create mode 100644 docker-compose.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ad8926cc..3e45b6be 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,21 +20,6 @@ jobs: matrix: python-version: ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11', 'pypy3.9'] - services: - # https://docs.github.com/en/actions/using-containerized-services/about-service-containers - redis: - # Docker Hub image - image: redis - # Set health checks to wait until redis has started - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - # Maps port 6379 on service container to the host - - 6379:6379 - steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -45,9 +30,20 @@ jobs: cache-dependency-path: | Pipfile setup.py + - uses: isbang/compose-action@v1.4.1 + with: + compose-file: "./docker-compose.yml" + down-flags: "--remove-orphans" + up-flags: "--no-start" - name: Install dependencies run: | make develop + make services-up + - name: Setup hostname + run: | + export CONTAINER_ID=$(docker-compose ps -q proxy) + export CONTAINER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $CONTAINER_ID) + echo "$CONTAINER_IP httpbin.local" | sudo tee -a /etc/hosts - name: Test run: | make test diff --git a/Makefile b/Makefile index 67697f19..a733c4ef 100644 --- a/Makefile +++ b/Makefile @@ -8,9 +8,15 @@ install-test-requirements: pipenv install --dev pipenv run python -c "import pipfile; pf = pipfile.load('Pipfile'); print('\n'.join(package+version for package, version in pf.data['default'].items()))" > requirements.txt +services-up: + pipenv run docker-compose up -d + +services-down: + pipenv run docker-compose down --remove-orphans + test-python: @echo "Running Python tests" - pipenv run python run_tests.py || exit 1 + pipenv run wait-for-it --service httpbin.local:443 --service localhost:6379 --timeout 5 -- pipenv run python run_tests.py || exit 1 @echo "" lint-python: @@ -35,6 +41,7 @@ publish: install-test-requirements clean: rm -rf *.egg-info dist/ - find . -type d -name __pycache__ -exec rm -rf {} \; + find . -type d -name __pycache__ | xargs rf -rf -.PHONY: clean publish safetest test setup develop lint-python test-python install-test-requirements install-dev-requirements +.PHONY: clean publish safetest test setup develop lint-python test-python +.PHONY: services-up services-down install-test-requirements install-dev-requirements diff --git a/Pipfile b/Pipfile index 8b8e7914..6a90f89e 100644 --- a/Pipfile +++ b/Pipfile @@ -30,6 +30,8 @@ wheel = "*" twine = "*" anaconda-client = "*" fastapi = "*" +docker-compose = "*" +wait-for-it = "*" [requires] python_version = "3" diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..7d69b8c8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +services: + proxy: + container_name: proxy + image: shroomlife/docker-https-proxy:latest + hostname: "httpbin.local" + ports: + - "80:80" + - "443:443" + httpbin: + container_name: httpbin.local.proxy + image: kennethreitz/httpbin:latest + redis: + image: redis:latest + ports: + - "6379:6379" diff --git a/mocket/mocket.py b/mocket/mocket.py index e4c50de3..3b08ec88 100644 --- a/mocket/mocket.py +++ b/mocket/mocket.py @@ -164,7 +164,7 @@ class MocketSocket: _secure_socket = False def __init__( - self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, *args, **kwargs + self, family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0, **kwargs ): self.true_socket = true_socket(family, type, proto) self._buflen = 65536 diff --git a/tests/main/test_http.py b/tests/main/test_http.py index f1893be0..13027a8e 100644 --- a/tests/main/test_http.py +++ b/tests/main/test_http.py @@ -30,7 +30,7 @@ def assertEqualHeaders(self, first, second, msg=None): class TrueHttpEntryTestCase(HttpTestCase): @mocketize def test_truesendall(self): - url = "http://httpbin.org/ip" + url = "http://httpbin.local/ip" resp = urlopen(url) self.assertEqual(resp.code, 200) resp = requests.get(url) @@ -38,7 +38,7 @@ def test_truesendall(self): @mocketize(truesocket_recording_dir=recording_directory) def test_truesendall_with_recording(self): - url = "http://httpbin.org/ip" + url = "http://httpbin.local/ip" urlopen(url) requests.get(url) @@ -54,11 +54,11 @@ def test_truesendall_with_recording(self): with io.open(dump_filename) as f: responses = json.load(f) - self.assertEqual(len(responses["httpbin.org"]["80"].keys()), 2) + self.assertEqual(len(responses["httpbin.local"]["80"].keys()), 2) @mocketize(truesocket_recording_dir=recording_directory) def test_truesendall_with_gzip_recording(self): - url = "http://httpbin.org/gzip" + url = "http://httpbin.local/gzip" requests.get(url) resp = requests.get(url) @@ -70,11 +70,11 @@ def test_truesendall_with_gzip_recording(self): with io.open(dump_filename) as f: responses = json.load(f) - assert len(responses["httpbin.org"]["80"].keys()) == 1 + assert len(responses["httpbin.local"]["80"].keys()) == 1 @mocketize(truesocket_recording_dir=recording_directory) def test_truesendall_with_chunk_recording(self): - url = "http://httpbin.org/range/70000?chunk_size=65536" + url = "http://httpbin.local/range/70000?chunk_size=65536" requests.get(url) resp = requests.get(url) @@ -86,12 +86,14 @@ def test_truesendall_with_chunk_recording(self): with io.open(dump_filename) as f: responses = json.load(f) - assert len(responses["httpbin.org"]["80"].keys()) == 1 + assert len(responses["httpbin.local"]["80"].keys()) == 1 @mocketize def test_wrongpath_truesendall(self): - Entry.register(Entry.GET, "http://httpbin.org/user.agent", Response(status=404)) - response = urlopen("http://httpbin.org/ip") + Entry.register( + Entry.GET, "http://httpbin.local/user.agent", Response(status=404) + ) + response = urlopen("http://httpbin.local/ip") self.assertEqual(response.code, 200) @@ -205,7 +207,7 @@ def test_mockhttp_entry_collect_duplicates(self): @mocketize def test_multipart(self): - url = "http://httpbin.org/post" + url = "http://httpbin.local/post" data = '--xXXxXXyYYzzz\r\nContent-Disposition: form-data; name="content"\r\nContent-Type: text/plain; charset=utf-8\r\nContent-Length: 68\r\n\r\nAction: comment\nText: Comment with attach\nAttachment: x1.txt, x2.txt\r\n--xXXxXXyYYzzz\r\nContent-Disposition: form-data; name="attachment_2"; filename="x.txt"\r\nContent-Type: text/plain\r\nContent-Length: 4\r\n\r\nbye\n\r\n--xXXxXXyYYzzz\r\nContent-Disposition: form-data; name="attachment_1"; filename="x.txt"\r\nContent-Type: text/plain\r\nContent-Length: 4\r\n\r\nbye\n\r\n--xXXxXXyYYzzz--\r\n' headers = { "Content-Length": "495", @@ -229,7 +231,7 @@ def test_multipart(self): "accept-encoding": "identity", "content-length": "495", "content-type": "multipart/form-data; boundary=xXXxXXyYYzzz", - "host": "httpbin.org", + "host": "httpbin.local", "user-agent": "Mocket", "connection": "keep-alive", }, @@ -300,9 +302,11 @@ def test_request_bodies(self): @mocketize(truesocket_recording_dir=os.path.dirname(__file__)) def test_truesendall_with_dump_from_recording(self): - requests.get("http://httpbin.org/ip", headers={"user-agent": "Fake-User-Agent"}) requests.get( - "http://httpbin.org/gzip", headers={"user-agent": "Fake-User-Agent"} + "http://httpbin.local/ip", headers={"user-agent": "Fake-User-Agent"} + ) + requests.get( + "http://httpbin.local/gzip", headers={"user-agent": "Fake-User-Agent"} ) dump_filename = os.path.join( @@ -311,7 +315,7 @@ def test_truesendall_with_dump_from_recording(self): with io.open(dump_filename) as f: responses = json.load(f) - self.assertEqual(len(responses["httpbin.org"]["80"].keys()), 2) + self.assertEqual(len(responses["httpbin.local"]["80"].keys()), 2) @mocketize def test_post_file_object(self): diff --git a/tests/main/test_http_aiohttp.py b/tests/main/test_http_aiohttp.py index 70492fa7..4cf5a690 100644 --- a/tests/main/test_http_aiohttp.py +++ b/tests/main/test_http_aiohttp.py @@ -16,7 +16,7 @@ class AioHttpEntryTestCase(TestCase): @mocketize def test_http_session(self): - url = "http://httpbin.org/ip" + url = "http://httpbin.local/ip" body = "asd" * 100 Entry.single_register(Entry.GET, url, body=body, status=404) Entry.single_register(Entry.POST, url, body=body * 2, status=201) @@ -42,7 +42,7 @@ async def main(_loop): @mocketize def test_https_session(self): - url = "https://httpbin.org/ip" + url = "https://httpbin.local/ip" body = "asd" * 100 Entry.single_register(Entry.GET, url, body=body, status=404) Entry.single_register(Entry.POST, url, body=body * 2, status=201) @@ -66,7 +66,7 @@ async def main(_loop): @httprettified def test_httprettish_session(self): - url = "https://httpbin.org/ip" + url = "https://httpbin.local/ip" HTTPretty.register_uri( HTTPretty.GET, url, diff --git a/tests/main/test_http_with_xxhash.py b/tests/main/test_http_with_xxhash.py index 148e53dc..4c295058 100644 --- a/tests/main/test_http_with_xxhash.py +++ b/tests/main/test_http_with_xxhash.py @@ -6,23 +6,26 @@ import os import requests -from tests.main.test_http import HttpTestCase from mocket import Mocket, mocketize +from tests.main.test_http import HttpTestCase class HttpEntryTestCase(HttpTestCase): - @mocketize(truesocket_recording_dir=os.path.dirname(__file__)) def test_truesendall_with_dump_from_recording(self): - requests.get('http://httpbin.org/ip', headers={"user-agent": "Fake-User-Agent"}) - requests.get('http://httpbin.org/gzip', headers={"user-agent": "Fake-User-Agent"}) + requests.get( + "http://httpbin.local/ip", headers={"user-agent": "Fake-User-Agent"} + ) + requests.get( + "http://httpbin.local/gzip", headers={"user-agent": "Fake-User-Agent"} + ) dump_filename = os.path.join( Mocket.get_truesocket_recording_dir(), - Mocket.get_namespace() + '.json', + Mocket.get_namespace() + ".json", ) with io.open(dump_filename) as f: responses = json.load(f) - self.assertEqual(len(responses['httpbin.org']['80'].keys()), 2) + self.assertEqual(len(responses["httpbin.local"]["80"].keys()), 2) diff --git a/tests/main/test_httpretty.py b/tests/main/test_httpretty.py index 94500de6..474a0dda 100644 --- a/tests/main/test_httpretty.py +++ b/tests/main/test_httpretty.py @@ -54,7 +54,10 @@ def test_httpretty_provides_easy_access_to_querystrings(): requests.get("http://yipit.com/?foo=bar&foo=baz&chuck=norris") expect(HTTPretty.last_request.querystring).to.equal( - {"foo": ["bar", "baz"], "chuck": ["norris"],} + { + "foo": ["bar", "baz"], + "chuck": ["norris"], + } ) @@ -118,13 +121,19 @@ def test_httpretty_should_allow_forcing_headers_requests(): HTTPretty.GET, "http://github.com/foo", body="", - forcing_headers={"Content-Type": "application/xml", "Content-Length": "19",}, + forcing_headers={ + "Content-Type": "application/xml", + "Content-Length": "19", + }, ) response = requests.get("http://github.com/foo") expect(dict(response.headers)).to.equal( - {"content-type": "application/xml", "content-length": "19",} + { + "content-type": "application/xml", + "content-length": "19", + } ) @@ -195,12 +204,18 @@ def test_can_inspect_last_request(): response = requests.post( "http://api.github.com", '{"username": "gabrielfalcao"}', - headers={"content-type": "text/json",}, + headers={ + "content-type": "text/json", + }, ) expect(HTTPretty.last_request.method).to.equal("POST") - expect(HTTPretty.last_request.body).to.equal(b'{"username": "gabrielfalcao"}',) - expect(HTTPretty.last_request.headers["content-type"]).to.equal("text/json",) + expect(HTTPretty.last_request.body).to.equal( + b'{"username": "gabrielfalcao"}', + ) + expect(HTTPretty.last_request.headers["content-type"]).to.equal( + "text/json", + ) expect(response.json()).to.equal({"repositories": ["HTTPretty", "lettuce"]}) @@ -216,12 +231,18 @@ def test_can_inspect_last_request_with_ssl(): response = requests.post( "https://secure.github.com", '{"username": "gabrielfalcao"}', - headers={"content-type": "text/json",}, + headers={ + "content-type": "text/json", + }, ) expect(HTTPretty.last_request.method).to.equal("POST") - expect(HTTPretty.last_request.body).to.equal(b'{"username": "gabrielfalcao"}',) - expect(HTTPretty.last_request.headers["content-type"]).to.equal("text/json",) + expect(HTTPretty.last_request.body).to.equal( + b'{"username": "gabrielfalcao"}', + ) + expect(HTTPretty.last_request.headers["content-type"]).to.equal( + "text/json", + ) expect(response.json()).to.equal({"repositories": ["HTTPretty", "lettuce"]}) @@ -240,14 +261,15 @@ def test_httpretty_ignores_querystrings_from_registered_uri(): @httprettified def test_multiline(): - url = "http://httpbin.org/post" + url = "http://httpbin.local/post" data = b"content=Im\r\na multiline\r\n\r\nsentence\r\n" headers = { "Content-Type": "application/x-www-form-urlencoded; charset=utf-8", "Accept": "text/plain", } HTTPretty.register_uri( - HTTPretty.POST, url, + HTTPretty.POST, + url, ) response = requests.post(url, data=data, headers=headers) @@ -264,7 +286,7 @@ def test_multiline(): @httprettified def test_multipart(): - url = "http://httpbin.org/post" + url = "http://httpbin.local/post" data = b'--xXXxXXyYYzzz\r\nContent-Disposition: form-data; name="content"\r\nContent-Type: text/plain; charset=utf-8\r\nContent-Length: 68\r\n\r\nAction: comment\nText: Comment with attach\nAttachment: x1.txt, x2.txt\r\n--xXXxXXyYYzzz\r\nContent-Disposition: form-data; name="attachment_2"; filename="x.txt"\r\nContent-Type: text/plain\r\nContent-Length: 4\r\n\r\nbye\n\r\n--xXXxXXyYYzzz\r\nContent-Disposition: form-data; name="attachment_1"; filename="x.txt"\r\nContent-Type: text/plain\r\nContent-Length: 4\r\n\r\nbye\n\r\n--xXXxXXyYYzzz--\r\n' headers = { "Content-Length": "495", @@ -272,7 +294,8 @@ def test_multipart(): "Accept": "text/plain", } HTTPretty.register_uri( - HTTPretty.POST, url, + HTTPretty.POST, + url, ) response = requests.post(url, data=data, headers=headers) expect(response.status_code).to.equal(200) diff --git a/tests/main/test_https.py b/tests/main/test_https.py index 0a54e325..b7f34ec8 100644 --- a/tests/main/test_https.py +++ b/tests/main/test_https.py @@ -44,7 +44,7 @@ def test_json(response): @pytest.mark.skipif('os.getenv("SKIP_TRUE_HTTP", False)') @mocketize(truesocket_recording_dir=recording_directory) def test_truesendall_with_recording_https(): - url = "https://httpbin.org/ip" + url = "https://httpbin.local/ip" requests.get(url, headers={"Accept": "application/json"}) resp = requests.get(url, headers={"Accept": "application/json"}) @@ -57,7 +57,7 @@ def test_truesendall_with_recording_https(): with io.open(dump_filename) as f: responses = json.load(f) - assert len(responses["httpbin.org"]["443"].keys()) == 1 + assert len(responses["httpbin.local"]["443"].keys()) == 1 @pytest.mark.skipif('os.getenv("SKIP_TRUE_HTTP", False)') @@ -65,7 +65,7 @@ def test_truesendall_after_mocket_session(): Mocket.enable() Mocket.disable() - url = "https://httpbin.org/ip" + url = "https://httpbin.local/ip" resp = requests.get(url) assert resp.status_code == 200 @@ -74,8 +74,8 @@ def test_truesendall_after_mocket_session(): def test_real_request_session(): session = requests.Session() - url1 = "https://httpbin.org/ip" - url2 = "http://httpbin.org/headers" + url1 = "https://httpbin.local/ip" + url2 = "http://httpbin.local/headers" with Mocketizer(): assert len(session.get(url1).content) < len(session.get(url2).content) diff --git a/tests/main/test_mode.py b/tests/main/test_mode.py index 6f2d8f7a..f16511dc 100644 --- a/tests/main/test_mode.py +++ b/tests/main/test_mode.py @@ -7,7 +7,7 @@ @mocketize(strict_mode=True) def test_strict_mode_fails(): - url = "https://httpbin.org/ip" + url = "https://httpbin.local/ip" with pytest.raises(StrictMocketException): requests.get(url) @@ -15,7 +15,7 @@ def test_strict_mode_fails(): @pytest.mark.skipif('os.getenv("SKIP_TRUE_HTTP", False)') def test_intermittent_strict_mode(): - url = "https://httpbin.org/ip" + url = "https://httpbin.local/ip" with Mocketizer(strict_mode=False): requests.get(url) diff --git a/tests/main/tests.main.test_http.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json b/tests/main/tests.main.test_http.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json index 2a56c805..e94154d1 100644 --- a/tests/main/tests.main.test_http.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json +++ b/tests/main/tests.main.test_http.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json @@ -1,14 +1,14 @@ { - "httpbin.org": { - "80": { - "31ae71d6074aa0e73fb4feb91f28546a": { - "request": "GET /gzip HTTP/1.1\r\nHost: httpbin.org\r\nuser-agent: Fake-User-Agent\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n", - "response": "48 54 54 50 2F 31 2E 31 20 32 30 30 20 4F 4B 0D 0A 43 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 0D 0A 53 65 72 76 65 72 3A 20 67 75 6E 69 63 6F 72 6E 2F 31 39 2E 39 2E 30 0D 0A 44 61 74 65 3A 20 54 75 65 2C 20 30 31 20 4A 61 6E 20 32 30 31 39 20 31 34 3A 35 32 3A 30 33 20 47 4D 54 0D 0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F 6A 73 6F 6E 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 6E 67 74 68 3A 20 31 38 33 0D 0A 43 6F 6E 74 65 6E 74 2D 45 6E 63 6F 64 69 6E 67 3A 20 67 7A 69 70 0D 0A 41 63 63 65 73 73 2D 43 6F 6E 74 72 6F 6C 2D 41 6C 6C 6F 77 2D 4F 72 69 67 69 6E 3A 20 2A 0D 0A 41 63 63 65 73 73 2D 43 6F 6E 74 72 6F 6C 2D 41 6C 6C 6F 77 2D 43 72 65 64 65 6E 74 69 61 6C 73 3A 20 74 72 75 65 0D 0A 56 69 61 3A 20 31 2E 31 20 76 65 67 75 72 0D 0A 0D 0A 1F 8B 08 00 93 7E 2B 5C 02 FF 4D 8F 4D 0E 82 30 10 46 F7 9C A2 E9 92 40 0D 92 68 74 47 0C EA 01 F4 00 D8 8E A5 01 3B 4D 5B 37 12 EE 6E 5B 12 74 39 EF 7B F3 37 65 84 50 F9 51 C6 80 A0 47 E2 ED 1B 0A 12 59 0F 9D 00 EB 02 9B 42 19 40 C3 39 18 1F 6A 9A 6F 72 9A A4 95 96 AD E6 28 94 96 31 8E D3 0A 22 E0 39 76 1E 56 F1 84 5A 03 F7 0A 75 74 F8 88 EE 97 5D D1 A5 C1 BD F7 E6 A1 34 43 2B D7 EC EE C0 96 8D 04 9D 8C 73 37 40 F9 87 82 33 2F F7 BE C0 F7 18 5F A0 97 F6 B6 74 53 B4 4A AA B4 EF 50 B3 6A BF 63 55 5D B1 7A 4B B3 39 FB 02 0D D4 A4 0E F8 00 00 00" - }, - "eaa1896a5d6eed6d4dd83a6696efc485": { - "request": "GET /ip HTTP/1.1\r\nHost: httpbin.org\r\nuser-agent: Fake-User-Agent\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n", - "response": "48 54 54 50 2F 31 2E 31 20 32 30 30 20 4F 4B 0D 0A 43 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 0D 0A 53 65 72 76 65 72 3A 20 67 75 6E 69 63 6F 72 6E 2F 31 39 2E 39 2E 30 0D 0A 44 61 74 65 3A 20 54 75 65 2C 20 30 31 20 4A 61 6E 20 32 30 31 39 20 31 34 3A 35 32 3A 30 32 20 47 4D 54 0D 0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F 6A 73 6F 6E 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 6E 67 74 68 3A 20 33 32 0D 0A 41 63 63 65 73 73 2D 43 6F 6E 74 72 6F 6C 2D 41 6C 6C 6F 77 2D 4F 72 69 67 69 6E 3A 20 2A 0D 0A 41 63 63 65 73 73 2D 43 6F 6E 74 72 6F 6C 2D 41 6C 6C 6F 77 2D 43 72 65 64 65 6E 74 69 61 6C 73 3A 20 74 72 75 65 0D 0A 56 69 61 3A 20 31 2E 31 20 76 65 67 75 72 0D 0A 0D 0A 7B 0A 20 20 22 6F 72 69 67 69 6E 22 3A 20 22 39 33 2E 31 37 36 2E 31 33 31 2E 33 32 22 0A 7D 0A" - } - } + "httpbin.local": { + "80": { + "03bc7d1e37b2615ce150043ddae0066d": { + "request": "GET /ip HTTP/1.1\r\nHost: httpbin.local\r\nuser-agent: Fake-User-Agent\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n", + "response": "48 54 54 50 2F 31 2E 31 20 32 30 30 20 4F 4B 0D 0A 58 2D 50 6F 77 65 72 65 64 2D 42 79 3A 20 45 78 70 72 65 73 73 0D 0A 73 65 72 76 65 72 3A 20 67 75 6E 69 63 6F 72 6E 2F 31 39 2E 39 2E 30 0D 0A 64 61 74 65 3A 20 53 61 74 2C 20 31 37 20 44 65 63 20 32 30 32 32 20 31 34 3A 31 31 3A 31 37 20 47 4D 54 0D 0A 63 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 0D 0A 63 6F 6E 74 65 6E 74 2D 74 79 70 65 3A 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F 6A 73 6F 6E 0D 0A 63 6F 6E 74 65 6E 74 2D 6C 65 6E 67 74 68 3A 20 32 39 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 6F 72 69 67 69 6E 3A 20 2A 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 63 72 65 64 65 6E 74 69 61 6C 73 3A 20 74 72 75 65 0D 0A 0D 0A 7B 0A 20 20 22 6F 72 69 67 69 6E 22 3A 20 22 31 37 32 2E 32 31 2E 30 2E 33 22 0A 7D 0A" + }, + "70109c06d1c4e826d2899eb7fe343854": { + "request": "GET /gzip HTTP/1.1\r\nHost: httpbin.local\r\nuser-agent: Fake-User-Agent\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n", + "response": "48 54 54 50 2F 31 2E 31 20 32 30 30 20 4F 4B 0D 0A 58 2D 50 6F 77 65 72 65 64 2D 42 79 3A 20 45 78 70 72 65 73 73 0D 0A 73 65 72 76 65 72 3A 20 67 75 6E 69 63 6F 72 6E 2F 31 39 2E 39 2E 30 0D 0A 64 61 74 65 3A 20 53 61 74 2C 20 31 37 20 44 65 63 20 32 30 32 32 20 31 34 3A 31 31 3A 31 37 20 47 4D 54 0D 0A 63 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 0D 0A 63 6F 6E 74 65 6E 74 2D 74 79 70 65 3A 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F 6A 73 6F 6E 0D 0A 63 6F 6E 74 65 6E 74 2D 6C 65 6E 67 74 68 3A 20 31 38 36 0D 0A 63 6F 6E 74 65 6E 74 2D 65 6E 63 6F 64 69 6E 67 3A 20 67 7A 69 70 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 6F 72 69 67 69 6E 3A 20 2A 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 63 72 65 64 65 6E 74 69 61 6C 73 3A 20 74 72 75 65 0D 0A 0D 0A 1F 8B 08 00 05 CE 9D 63 02 FF 4D 8F 41 0E C2 20 10 45 F7 3D 05 61 D9 14 B4 75 61 E2 AE 31 55 0F A0 07 40 18 29 29 02 A1 E8 C2 A6 77 17 68 52 5D CE 9B 37 7F 66 A6 02 21 2C 3F CA 39 10 F8 80 82 7F 41 85 12 EB 81 09 F0 63 64 53 2C 23 68 39 07 17 62 8D CB 4D 89 B3 B4 52 D2 19 6E 85 32 32 B5 53 5A 85 04 3C 34 0B B0 8A 47 6B 0C F0 A0 AC 49 CE 00 E0 08 D3 EA FD 13 2E 76 CC E9 7D 08 EE AE 0C D5 96 33 BD 76 6F 23 78 D2 4A 30 D9 39 B1 01 C8 1F 8A CE BC 9C FD 84 D0 DB F4 09 3E 77 D7 65 1A 5B AF A4 CA 6B EB 7D 43 9B 9A 6E E9 0E 17 73 F1 05 61 37 56 13 FC 00 00 00" + } } -} \ No newline at end of file + } +} diff --git a/tests/main/tests.main.test_http_gevent.GeventHttpEntryTestCase.test_truesendall_with_dump_from_recording.json b/tests/main/tests.main.test_http_gevent.GeventHttpEntryTestCase.test_truesendall_with_dump_from_recording.json index 01564b00..e94154d1 100644 --- a/tests/main/tests.main.test_http_gevent.GeventHttpEntryTestCase.test_truesendall_with_dump_from_recording.json +++ b/tests/main/tests.main.test_http_gevent.GeventHttpEntryTestCase.test_truesendall_with_dump_from_recording.json @@ -1,13 +1,13 @@ { - "httpbin.org": { + "httpbin.local": { "80": { - "31ae71d6074aa0e73fb4feb91f28546a": { - "request": "GET /gzip HTTP/1.1\r\nHost: httpbin.org\r\nuser-agent: Fake-User-Agent\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n", - "response": "48 54 54 50 2F 31 2E 31 20 32 30 30 20 4F 4B 0D 0A 44 61 74 65 3A 20 4D 6F 6E 2C 20 31 35 20 4A 75 6E 20 32 30 32 30 20 31 36 3A 31 39 3A 34 32 20 47 4D 54 0D 0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F 6A 73 6F 6E 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 6E 67 74 68 3A 20 34 39 31 0D 0A 43 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 0D 0A 73 65 72 76 65 72 3A 20 69 73 74 69 6F 2D 65 6E 76 6F 79 0D 0A 63 6F 6E 74 65 6E 74 2D 65 6E 63 6F 64 69 6E 67 3A 20 67 7A 69 70 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 6F 72 69 67 69 6E 3A 20 2A 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 63 72 65 64 65 6E 74 69 61 6C 73 3A 20 74 72 75 65 0D 0A 78 2D 65 6E 76 6F 79 2D 75 70 73 74 72 65 61 6D 2D 73 65 72 76 69 63 65 2D 74 69 6D 65 3A 20 32 0D 0A 0D 0A 1F 8B 08 00 9E 9F E7 5E 02 FF 7D 52 CB 6E DB 30 10 BC FB 2B 0C 1D 03 53 A2 44 EA 15 C3 07 C7 70 9A 00 3D 14 79 00 3D E4 B2 22 57 B2 5A 99 14 48 3A A9 13 E4 DF 4B C9 8D EA 5C 72 DC D9 E1 70 77 76 DE 66 F3 79 D0 BC B6 7D 8F 32 B8 9C 3B 73 C0 C5 7C C0 76 08 12 8D F5 D8 9B 2F 3D B0 16 02 7B E7 EB E0 22 BA 08 46 D2 84 92 AD 12 5A B6 AA 19 DA 83 DA 62 2E B1 EE C0 E1 44 DC 68 E5 50 39 F2 1D 55 E3 76 03 8F 4E BD 1B 6D 47 E1 9D 73 7D D5 AA 50 9B 66 EA 3D 5A 34 64 DD F8 A7 03 E3 1A 7E 23 39 83 3E 58 3F C9 7A FF AA C8 83 01 81 E4 76 D8 24 B8 D3 DA AD 62 92 22 E6 65 5D 22 C9 81 A7 09 24 05 8D 19 4B 91 49 46 53 4C 0A 80 33 8D 2B 46 7E 80 F1 BA B6 07 D5 8E 2A 92 E6 82 97 AC AA 93 8A F3 94 FD 9F 79 64 DF C3 BE EF 46 E3 CE B6 39 75 26 05 CE 38 16 34 C7 18 4B 9A 15 50 7F E6 8D 13 9F 88 05 CB CA 18 21 CF B8 A0 09 72 FE C5 D7 5B F5 AC 8F 64 FB C7 A1 51 D0 91 B5 94 06 ED 70 AB 20 A6 61 4C 69 58 64 21 CF CF 1E 5C 6B F3 02 46 A2 24 9B AE 1D CE B0 41 33 1A 7A 75 5C D9 BE AD 6B BC 8C 22 D1 1D AC 57 0C 3B 2D A0 8B 94 8D FE DD 83 B4 D6 B5 3A B2 F0 01 2C 6F C0 EE 56 B4 4A CB 5A F2 9A C7 59 46 65 21 A1 A6 32 66 39 A7 7E 83 2C A7 59 05 34 A7 B2 64 09 02 67 58 F2 B4 4E 68 2D 53 19 C7 49 2E 52 81 CB FB 43 F5 0B 85 5B 3D 05 4F C1 F2 F1 EE F6 8B 49 C6 09 88 3D 7A 74 3F 0C 72 AA 7D E0 86 BD 1B 9F B3 17 38 12 1F 8B E7 D6 DF 1F 84 D0 07 1F 0E BF FC FB 29 CC 7B 74 3B 3D 9A FC 6D FB 70 B2 25 D0 A6 6D 5A 35 7A 56 14 61 92 85 49 5C 86 3E 1B 8B 4F 16 CE DE 67 7F 01 78 59 1B AD 23 03 00 00" + "03bc7d1e37b2615ce150043ddae0066d": { + "request": "GET /ip HTTP/1.1\r\nHost: httpbin.local\r\nuser-agent: Fake-User-Agent\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n", + "response": "48 54 54 50 2F 31 2E 31 20 32 30 30 20 4F 4B 0D 0A 58 2D 50 6F 77 65 72 65 64 2D 42 79 3A 20 45 78 70 72 65 73 73 0D 0A 73 65 72 76 65 72 3A 20 67 75 6E 69 63 6F 72 6E 2F 31 39 2E 39 2E 30 0D 0A 64 61 74 65 3A 20 53 61 74 2C 20 31 37 20 44 65 63 20 32 30 32 32 20 31 34 3A 31 31 3A 31 37 20 47 4D 54 0D 0A 63 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 0D 0A 63 6F 6E 74 65 6E 74 2D 74 79 70 65 3A 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F 6A 73 6F 6E 0D 0A 63 6F 6E 74 65 6E 74 2D 6C 65 6E 67 74 68 3A 20 32 39 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 6F 72 69 67 69 6E 3A 20 2A 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 63 72 65 64 65 6E 74 69 61 6C 73 3A 20 74 72 75 65 0D 0A 0D 0A 7B 0A 20 20 22 6F 72 69 67 69 6E 22 3A 20 22 31 37 32 2E 32 31 2E 30 2E 33 22 0A 7D 0A" }, - "eaa1896a5d6eed6d4dd83a6696efc485": { - "request": "GET /ip HTTP/1.1\r\nHost: httpbin.org\r\nuser-agent: Fake-User-Agent\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n", - "response": "48 54 54 50 2F 31 2E 31 20 32 30 30 20 4F 4B 0D 0A 44 61 74 65 3A 20 4D 6F 6E 2C 20 31 35 20 4A 75 6E 20 32 30 32 30 20 31 36 3A 31 39 3A 34 32 20 47 4D 54 0D 0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F 6A 73 6F 6E 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 6E 67 74 68 3A 20 34 36 0D 0A 43 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 0D 0A 73 65 72 76 65 72 3A 20 69 73 74 69 6F 2D 65 6E 76 6F 79 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 6F 72 69 67 69 6E 3A 20 2A 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 63 72 65 64 65 6E 74 69 61 6C 73 3A 20 74 72 75 65 0D 0A 78 2D 65 6E 76 6F 79 2D 75 70 73 74 72 65 61 6D 2D 73 65 72 76 69 63 65 2D 74 69 6D 65 3A 20 31 0D 0A 0D 0A 7B 0A 20 20 22 6F 72 69 67 69 6E 22 3A 20 22 31 38 38 2E 32 36 2E 32 31 39 2E 31 33 33 2C 31 30 2E 31 30 30 2E 38 36 2E 34 37 22 0A 7D 0A" + "70109c06d1c4e826d2899eb7fe343854": { + "request": "GET /gzip HTTP/1.1\r\nHost: httpbin.local\r\nuser-agent: Fake-User-Agent\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n", + "response": "48 54 54 50 2F 31 2E 31 20 32 30 30 20 4F 4B 0D 0A 58 2D 50 6F 77 65 72 65 64 2D 42 79 3A 20 45 78 70 72 65 73 73 0D 0A 73 65 72 76 65 72 3A 20 67 75 6E 69 63 6F 72 6E 2F 31 39 2E 39 2E 30 0D 0A 64 61 74 65 3A 20 53 61 74 2C 20 31 37 20 44 65 63 20 32 30 32 32 20 31 34 3A 31 31 3A 31 37 20 47 4D 54 0D 0A 63 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 0D 0A 63 6F 6E 74 65 6E 74 2D 74 79 70 65 3A 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F 6A 73 6F 6E 0D 0A 63 6F 6E 74 65 6E 74 2D 6C 65 6E 67 74 68 3A 20 31 38 36 0D 0A 63 6F 6E 74 65 6E 74 2D 65 6E 63 6F 64 69 6E 67 3A 20 67 7A 69 70 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 6F 72 69 67 69 6E 3A 20 2A 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 63 72 65 64 65 6E 74 69 61 6C 73 3A 20 74 72 75 65 0D 0A 0D 0A 1F 8B 08 00 05 CE 9D 63 02 FF 4D 8F 41 0E C2 20 10 45 F7 3D 05 61 D9 14 B4 75 61 E2 AE 31 55 0F A0 07 40 18 29 29 02 A1 E8 C2 A6 77 17 68 52 5D CE 9B 37 7F 66 A6 02 21 2C 3F CA 39 10 F8 80 82 7F 41 85 12 EB 81 09 F0 63 64 53 2C 23 68 39 07 17 62 8D CB 4D 89 B3 B4 52 D2 19 6E 85 32 32 B5 53 5A 85 04 3C 34 0B B0 8A 47 6B 0C F0 A0 AC 49 CE 00 E0 08 D3 EA FD 13 2E 76 CC E9 7D 08 EE AE 0C D5 96 33 BD 76 6F 23 78 D2 4A 30 D9 39 B1 01 C8 1F 8A CE BC 9C FD 84 D0 DB F4 09 3E 77 D7 65 1A 5B AF A4 CA 6B EB 7D 43 9B 9A 6E E9 0E 17 73 F1 05 61 37 56 13 FC 00 00 00" } } } diff --git a/tests/main/tests.main.test_http_with_xxhash.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json b/tests/main/tests.main.test_http_with_xxhash.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json index 89de0647..e94154d1 100644 --- a/tests/main/tests.main.test_http_with_xxhash.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json +++ b/tests/main/tests.main.test_http_with_xxhash.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json @@ -1,14 +1,14 @@ { - "httpbin.org": { - "80": { - "27f55d9c": { - "request": "GET /gzip HTTP/1.1\r\nHost: httpbin.org\r\nuser-agent: Fake-User-Agent\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n", - "response": "48 54 54 50 2F 31 2E 31 20 32 30 30 20 4F 4B 0D 0A 43 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 0D 0A 53 65 72 76 65 72 3A 20 67 75 6E 69 63 6F 72 6E 2F 31 39 2E 39 2E 30 0D 0A 44 61 74 65 3A 20 54 75 65 2C 20 30 31 20 4A 61 6E 20 32 30 31 39 20 31 34 3A 35 32 3A 30 35 20 47 4D 54 0D 0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F 6A 73 6F 6E 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 6E 67 74 68 3A 20 31 38 33 0D 0A 43 6F 6E 74 65 6E 74 2D 45 6E 63 6F 64 69 6E 67 3A 20 67 7A 69 70 0D 0A 41 63 63 65 73 73 2D 43 6F 6E 74 72 6F 6C 2D 41 6C 6C 6F 77 2D 4F 72 69 67 69 6E 3A 20 2A 0D 0A 41 63 63 65 73 73 2D 43 6F 6E 74 72 6F 6C 2D 41 6C 6C 6F 77 2D 43 72 65 64 65 6E 74 69 61 6C 73 3A 20 74 72 75 65 0D 0A 56 69 61 3A 20 31 2E 31 20 76 65 67 75 72 0D 0A 0D 0A 1F 8B 08 00 95 7E 2B 5C 02 FF 4D 8F 4D 0E 82 30 10 46 F7 9C A2 E9 92 40 0D 92 68 74 47 0C EA 01 F4 00 D8 8E A5 01 3B 4D 5B 37 12 EE 6E 5B 12 74 39 EF 7B F3 37 65 84 50 F9 51 C6 80 A0 47 E2 ED 1B 0A 12 59 0F 9D 00 EB 02 9B 42 19 40 C3 39 18 1F 6A 9A 6F 72 9A A4 95 96 AD E6 28 94 96 31 8E D3 0A 22 E0 39 76 1E 56 F1 84 5A 03 F7 0A 75 74 F8 88 EE 97 5D D1 A5 C1 BD F7 E6 A1 34 43 2B D7 EC EE C0 96 8D 04 9D 8C 73 37 40 F9 87 82 33 2F F7 BE C0 F7 18 5F A0 97 F6 B6 74 53 B4 4A AA B4 EF 50 B3 6A BF 63 55 5D B1 7A 4B B3 39 FB 02 0D D4 A4 0E F8 00 00 00" - }, - "faef8d42": { - "request": "GET /ip HTTP/1.1\r\nHost: httpbin.org\r\nuser-agent: Fake-User-Agent\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n", - "response": "48 54 54 50 2F 31 2E 31 20 32 30 30 20 4F 4B 0D 0A 43 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 0D 0A 53 65 72 76 65 72 3A 20 67 75 6E 69 63 6F 72 6E 2F 31 39 2E 39 2E 30 0D 0A 44 61 74 65 3A 20 54 75 65 2C 20 30 31 20 4A 61 6E 20 32 30 31 39 20 31 34 3A 35 32 3A 30 34 20 47 4D 54 0D 0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F 6A 73 6F 6E 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 6E 67 74 68 3A 20 33 32 0D 0A 41 63 63 65 73 73 2D 43 6F 6E 74 72 6F 6C 2D 41 6C 6C 6F 77 2D 4F 72 69 67 69 6E 3A 20 2A 0D 0A 41 63 63 65 73 73 2D 43 6F 6E 74 72 6F 6C 2D 41 6C 6C 6F 77 2D 43 72 65 64 65 6E 74 69 61 6C 73 3A 20 74 72 75 65 0D 0A 56 69 61 3A 20 31 2E 31 20 76 65 67 75 72 0D 0A 0D 0A 7B 0A 20 20 22 6F 72 69 67 69 6E 22 3A 20 22 39 33 2E 31 37 36 2E 31 33 31 2E 33 32 22 0A 7D 0A" - } - } + "httpbin.local": { + "80": { + "03bc7d1e37b2615ce150043ddae0066d": { + "request": "GET /ip HTTP/1.1\r\nHost: httpbin.local\r\nuser-agent: Fake-User-Agent\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n", + "response": "48 54 54 50 2F 31 2E 31 20 32 30 30 20 4F 4B 0D 0A 58 2D 50 6F 77 65 72 65 64 2D 42 79 3A 20 45 78 70 72 65 73 73 0D 0A 73 65 72 76 65 72 3A 20 67 75 6E 69 63 6F 72 6E 2F 31 39 2E 39 2E 30 0D 0A 64 61 74 65 3A 20 53 61 74 2C 20 31 37 20 44 65 63 20 32 30 32 32 20 31 34 3A 31 31 3A 31 37 20 47 4D 54 0D 0A 63 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 0D 0A 63 6F 6E 74 65 6E 74 2D 74 79 70 65 3A 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F 6A 73 6F 6E 0D 0A 63 6F 6E 74 65 6E 74 2D 6C 65 6E 67 74 68 3A 20 32 39 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 6F 72 69 67 69 6E 3A 20 2A 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 63 72 65 64 65 6E 74 69 61 6C 73 3A 20 74 72 75 65 0D 0A 0D 0A 7B 0A 20 20 22 6F 72 69 67 69 6E 22 3A 20 22 31 37 32 2E 32 31 2E 30 2E 33 22 0A 7D 0A" + }, + "70109c06d1c4e826d2899eb7fe343854": { + "request": "GET /gzip HTTP/1.1\r\nHost: httpbin.local\r\nuser-agent: Fake-User-Agent\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\n\r\n", + "response": "48 54 54 50 2F 31 2E 31 20 32 30 30 20 4F 4B 0D 0A 58 2D 50 6F 77 65 72 65 64 2D 42 79 3A 20 45 78 70 72 65 73 73 0D 0A 73 65 72 76 65 72 3A 20 67 75 6E 69 63 6F 72 6E 2F 31 39 2E 39 2E 30 0D 0A 64 61 74 65 3A 20 53 61 74 2C 20 31 37 20 44 65 63 20 32 30 32 32 20 31 34 3A 31 31 3A 31 37 20 47 4D 54 0D 0A 63 6F 6E 6E 65 63 74 69 6F 6E 3A 20 6B 65 65 70 2D 61 6C 69 76 65 0D 0A 63 6F 6E 74 65 6E 74 2D 74 79 70 65 3A 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F 6A 73 6F 6E 0D 0A 63 6F 6E 74 65 6E 74 2D 6C 65 6E 67 74 68 3A 20 31 38 36 0D 0A 63 6F 6E 74 65 6E 74 2D 65 6E 63 6F 64 69 6E 67 3A 20 67 7A 69 70 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 6F 72 69 67 69 6E 3A 20 2A 0D 0A 61 63 63 65 73 73 2D 63 6F 6E 74 72 6F 6C 2D 61 6C 6C 6F 77 2D 63 72 65 64 65 6E 74 69 61 6C 73 3A 20 74 72 75 65 0D 0A 0D 0A 1F 8B 08 00 05 CE 9D 63 02 FF 4D 8F 41 0E C2 20 10 45 F7 3D 05 61 D9 14 B4 75 61 E2 AE 31 55 0F A0 07 40 18 29 29 02 A1 E8 C2 A6 77 17 68 52 5D CE 9B 37 7F 66 A6 02 21 2C 3F CA 39 10 F8 80 82 7F 41 85 12 EB 81 09 F0 63 64 53 2C 23 68 39 07 17 62 8D CB 4D 89 B3 B4 52 D2 19 6E 85 32 32 B5 53 5A 85 04 3C 34 0B B0 8A 47 6B 0C F0 A0 AC 49 CE 00 E0 08 D3 EA FD 13 2E 76 CC E9 7D 08 EE AE 0C D5 96 33 BD 76 6F 23 78 D2 4A 30 D9 39 B1 01 C8 1F 8A CE BC 9C FD 84 D0 DB F4 09 3E 77 D7 65 1A 5B AF A4 CA 6B EB 7D 43 9B 9A 6E E9 0E 17 73 F1 05 61 37 56 13 FC 00 00 00" + } } -} \ No newline at end of file + } +} diff --git a/tests/tests38/test_http_aiohttp.py b/tests/tests38/test_http_aiohttp.py index 348a7a01..7521e5a3 100644 --- a/tests/tests38/test_http_aiohttp.py +++ b/tests/tests38/test_http_aiohttp.py @@ -13,7 +13,7 @@ class AioHttpEntryTestCase(IsolatedAsyncioTestCase): @async_mocketize async def test_http_session(self): - url = "http://httpbin.org/ip" + url = "http://httpbin.local/ip" body = "asd" * 100 Entry.single_register(Entry.GET, url, body=body, status=404) Entry.single_register(Entry.POST, url, body=body * 2, status=201) @@ -35,7 +35,7 @@ async def test_http_session(self): @async_mocketize async def test_https_session(self): - url = "https://httpbin.org/ip" + url = "https://httpbin.local/ip" body = "asd" * 100 Entry.single_register(Entry.GET, url, body=body, status=404) Entry.single_register(Entry.POST, url, body=body * 2, status=201) @@ -55,7 +55,7 @@ async def test_https_session(self): @async_httprettified async def test_httprettish_session(self): - url = "https://httpbin.org/ip" + url = "https://httpbin.local/ip" HTTPretty.register_uri( HTTPretty.GET, url,