Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-mocket for openSUSE:Factory checked in at 2023-05-13 17:17:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-mocket (Old) and /work/SRC/openSUSE:Factory/.python-mocket.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mocket" Sat May 13 17:17:18 2023 rev:27 rq:1086730 version:3.11.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-mocket/python-mocket.changes 2023-02-28 12:48:23.364381922 +0100 +++ /work/SRC/openSUSE:Factory/.python-mocket.new.1533/python-mocket.changes 2023-05-13 17:17:28.054321150 +0200 @@ -1,0 +2,9 @@ +Fri May 12 10:42:12 UTC 2023 - Markéta Machová <[email protected]> + +- Update to 3.11.1 + * Fix for `urllib2>=2` + * Bump version for publishing a new release + * Adding local container for partially replacing httpbin.org usage + * Replacing httpbin.org with mockbin.org from Kong for what needs HTTPS + +------------------------------------------------------------------- Old: ---- mocket-3.11.0.tar.gz New: ---- mocket-3.11.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-mocket.spec ++++++ --- /var/tmp/diff_new_pack.fyCYpv/_old 2023-05-13 17:17:28.778325315 +0200 +++ /var/tmp/diff_new_pack.fyCYpv/_new 2023-05-13 17:17:28.782325339 +0200 @@ -27,7 +27,7 @@ %define skip_python2 1 Name: python-mocket%{psuffix} -Version: 3.11.0 +Version: 3.11.1 Release: 0 Summary: Python socket mock framework License: BSD-3-Clause @@ -37,7 +37,6 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-decorator >= 4 -Requires: python-http-parser >= 0.9.0 Requires: python-httptools Requires: python-python-magic >= 0.4.5 Requires: python-urllib3 >= 1.25.3 ++++++ mocket-3.11.0.tar.gz -> mocket-3.11.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/LICENSE new/mocket-3.11.1/LICENSE --- old/mocket-3.11.0/LICENSE 2022-02-19 13:30:19.000000000 +0100 +++ new/mocket-3.11.1/LICENSE 2023-02-21 22:35:00.000000000 +0100 @@ -1,4 +1,4 @@ -Copyright (c) 2017-2022 Giorgio Salluzzo and individual contributors. All rights reserved. +Copyright (c) 2017-2023 Giorgio Salluzzo and individual contributors. All rights reserved. Copyright (c) 2013-2017 Andrea de Marco, Giorgio Salluzzo and individual contributors. All rights reserved. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/PKG-INFO new/mocket-3.11.1/PKG-INFO --- old/mocket-3.11.0/PKG-INFO 2023-02-19 16:56:36.339939000 +0100 +++ new/mocket-3.11.1/PKG-INFO 2023-05-12 12:32:09.496923400 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: mocket -Version: 3.11.0 +Version: 3.11.1 Summary: Socket Mock Framework - for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support Home-page: https://github.com/mindflayer/python-mocket Author: Giorgio Salluzzo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/mocket/__init__.py new/mocket-3.11.1/mocket/__init__.py --- old/mocket-3.11.0/mocket/__init__.py 2023-02-19 16:55:48.000000000 +0100 +++ new/mocket-3.11.1/mocket/__init__.py 2023-05-12 12:31:56.000000000 +0200 @@ -3,4 +3,4 @@ __all__ = ("async_mocketize", "mocketize", "Mocket", "MocketEntry", "Mocketizer") -__version__ = "3.11.0" +__version__ = "3.11.1" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/mocket/mocket.py new/mocket-3.11.1/mocket/mocket.py --- old/mocket-3.11.0/mocket/mocket.py 2023-02-19 12:01:29.000000000 +0100 +++ new/mocket-3.11.1/mocket/mocket.py 2023-05-12 12:31:56.000000000 +0200 @@ -15,7 +15,11 @@ import urllib3 from urllib3.connection import match_hostname as urllib3_match_hostname from urllib3.util.ssl_ import ssl_wrap_socket as urllib3_ssl_wrap_socket -from urllib3.util.ssl_ import wrap_socket as urllib3_wrap_socket + +try: + from urllib3.util.ssl_ import wrap_socket as urllib3_wrap_socket +except ImportError: + urllib3_wrap_socket = None from .compat import basestring, byte_type, decode_from_bytes, encode_to_bytes, text_type from .exceptions import StrictMocketException @@ -68,6 +72,7 @@ def __set__(self, *args): pass + minimum_version = FakeSetter() options = FakeSetter() verify_mode = FakeSetter(ssl.CERT_NONE) @@ -164,7 +169,7 @@ _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 @@ -380,7 +385,6 @@ # dump the resulting dictionary to a JSON file if Mocket.get_truesocket_recording_dir(): - # update the dictionary with request and response lines response_dict["request"] = req response_dict["response"] = hexdump(encoded_response) @@ -509,12 +513,15 @@ urllib3.util.ssl_.ssl_wrap_socket = urllib3.util.ssl_.__dict__[ "ssl_wrap_socket" ] = FakeSSLContext.wrap_socket + urllib3.util.ssl_wrap_socket = urllib3.util.__dict__[ + "ssl_wrap_socket" + ] = FakeSSLContext.wrap_socket urllib3.connection.ssl_wrap_socket = urllib3.connection.__dict__[ "ssl_wrap_socket" ] = FakeSSLContext.wrap_socket urllib3.connection.match_hostname = urllib3.connection.__dict__[ "match_hostname" - ] = lambda cert, hostname: None + ] = lambda *args: None if pyopenssl_override: # pragma: no cover # Take out the pyopenssl version - use the default implementation extract_from_urllib3() @@ -540,6 +547,9 @@ urllib3.util.ssl_.ssl_wrap_socket = urllib3.util.ssl_.__dict__[ "ssl_wrap_socket" ] = true_urllib3_ssl_wrap_socket + urllib3.util.ssl_wrap_socket = urllib3.util.__dict__[ + "ssl_wrap_socket" + ] = true_urllib3_ssl_wrap_socket urllib3.connection.ssl_wrap_socket = urllib3.connection.__dict__[ "ssl_wrap_socket" ] = true_urllib3_ssl_wrap_socket diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/mocket/utils.py new/mocket-3.11.1/mocket/utils.py --- old/mocket-3.11.0/mocket/utils.py 2023-02-19 12:01:29.000000000 +0100 +++ new/mocket-3.11.1/mocket/utils.py 2023-05-12 12:31:56.000000000 +0200 @@ -5,7 +5,7 @@ from .compat import decode_from_bytes, encode_to_bytes -SSL_PROTOCOL = ssl.PROTOCOL_SSLv23 +SSL_PROTOCOL = ssl.PROTOCOL_TLSv1_2 class MocketSocketCore(io.BytesIO): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/mocket.egg-info/PKG-INFO new/mocket-3.11.1/mocket.egg-info/PKG-INFO --- old/mocket-3.11.0/mocket.egg-info/PKG-INFO 2023-02-19 16:56:36.000000000 +0100 +++ new/mocket-3.11.1/mocket.egg-info/PKG-INFO 2023-05-12 12:32:09.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: mocket -Version: 3.11.0 +Version: 3.11.1 Summary: Socket Mock Framework - for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support Home-page: https://github.com/mindflayer/python-mocket Author: Giorgio Salluzzo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/mocket.egg-info/SOURCES.txt new/mocket-3.11.1/mocket.egg-info/SOURCES.txt --- old/mocket-3.11.0/mocket.egg-info/SOURCES.txt 2023-02-19 16:56:36.000000000 +0100 +++ new/mocket-3.11.1/mocket.egg-info/SOURCES.txt 2023-05-12 12:32:09.000000000 +0200 @@ -24,11 +24,11 @@ tests/fluidicon.png tests/main/__init__.py tests/main/test_http.py -tests/main/test_http_aiohttp.py tests/main/test_http_gevent.py tests/main/test_http_with_xxhash.py tests/main/test_httpretty.py tests/main/test_https.py +tests/main/test_httpx.py tests/main/test_mocket.py tests/main/test_mode.py tests/main/test_pook.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/tests/main/test_http.py new/mocket-3.11.1/tests/main/test_http.py --- old/mocket-3.11.0/tests/main/test_http.py 2023-02-19 16:55:48.000000000 +0100 +++ new/mocket-3.11.1/tests/main/test_http.py 2023-05-12 12:31:56.000000000 +0200 @@ -28,7 +28,7 @@ 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) @@ -37,7 +37,7 @@ def test_truesendall_with_recording(self): with tempfile.TemporaryDirectory() as temp_dir: with Mocketizer(truesocket_recording_dir=temp_dir): - url = "http://httpbin.org/ip" + url = "http://httpbin.local/ip" urlopen(url) requests.get(url) @@ -54,12 +54,12 @@ 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) def test_truesendall_with_gzip_recording(self): with tempfile.TemporaryDirectory() as temp_dir: with Mocketizer(truesocket_recording_dir=temp_dir): - url = "http://httpbin.org/gzip" + url = "http://httpbin.local/gzip" requests.get(url) resp = requests.get(url) @@ -72,12 +72,12 @@ 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 def test_truesendall_with_chunk_recording(self): with tempfile.TemporaryDirectory() as temp_dir: with Mocketizer(truesocket_recording_dir=temp_dir): - 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) @@ -90,12 +90,14 @@ 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) @@ -209,7 +211,7 @@ @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", @@ -233,7 +235,7 @@ "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", }, @@ -304,9 +306,11 @@ @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( @@ -315,7 +319,7 @@ 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/tests/main/test_http_aiohttp.py new/mocket-3.11.1/tests/main/test_http_aiohttp.py --- old/mocket-3.11.0/tests/main/test_http_aiohttp.py 2023-02-19 16:55:48.000000000 +0100 +++ new/mocket-3.11.1/tests/main/test_http_aiohttp.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,79 +0,0 @@ -import json - -import aiohttp -import pytest -from asgiref.sync import async_to_sync - -from mocket.mocket import Mocket, mocketize -from mocket.mockhttp import Entry -from mocket.plugins.httpretty import httprettified, httpretty - -timeout = aiohttp.ClientTimeout(total=3) - - -@mocketize -def test_http_session(): - url = "http://httpbin.org/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) - - @async_to_sync - async def perform_aiohttp_transactions(): - async with aiohttp.ClientSession(timeout=timeout) as session: - async with session.get(url) as get_response: - assert get_response.status == 404 - assert await get_response.text() == body - - async with session.post(url, data=body * 6) as post_response: - assert post_response.status == 201 - assert await post_response.text() == body * 2 - assert Mocket.last_request().method == "POST" - assert Mocket.last_request().body == body * 6 - - perform_aiohttp_transactions() - assert len(Mocket.request_list()) == 2 - - [email protected] -@mocketize -def test_https_session(): - url = "https://httpbin.org/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) - - @async_to_sync - async def perform_aiohttp_transactions(): - async with aiohttp.ClientSession(timeout=timeout) as session: - async with session.get(url) as get_response: - assert get_response.status == 404 - assert await get_response.text() == body - - async with session.post(url, data=body * 6) as post_response: - assert post_response.status == 201 - assert await post_response.text() == body * 2 - - perform_aiohttp_transactions() - assert len(Mocket.request_list()) == 2 - - [email protected] -@httprettified -def test_httprettish_session(): - url = "https://httpbin.org/ip" - httpretty.register_uri( - httpretty.GET, - url, - body=json.dumps(dict(origin="127.0.0.1")), - ) - - @async_to_sync - async def perform_aiohttp_transactions(): - async with aiohttp.ClientSession(timeout=timeout) as session: - async with session.get(url) as get_response: - assert get_response.status == 200 - assert await get_response.text() == '{"origin": "127.0.0.1"}' - - perform_aiohttp_transactions() - assert len(httpretty.latest_requests) == 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/tests/main/test_http_with_xxhash.py new/mocket-3.11.1/tests/main/test_http_with_xxhash.py --- old/mocket-3.11.0/tests/main/test_http_with_xxhash.py 2023-02-19 12:01:29.000000000 +0100 +++ new/mocket-3.11.1/tests/main/test_http_with_xxhash.py 2023-05-12 12:31:56.000000000 +0200 @@ -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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/tests/main/test_httpretty.py new/mocket-3.11.1/tests/main/test_httpretty.py --- old/mocket-3.11.0/tests/main/test_httpretty.py 2023-02-19 12:01:29.000000000 +0100 +++ new/mocket-3.11.1/tests/main/test_httpretty.py 2023-05-12 12:31:56.000000000 +0200 @@ -54,7 +54,10 @@ 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 @@ HTTPretty.GET, "http://github.com/foo", body="<root><baz /</root>", - 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 @@ 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 @@ 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 @@ @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 @@ @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 @@ "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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/tests/main/test_https.py new/mocket-3.11.1/tests/main/test_https.py --- old/mocket-3.11.0/tests/main/test_https.py 2023-02-19 16:55:48.000000000 +0100 +++ new/mocket-3.11.1/tests/main/test_https.py 2023-05-12 12:31:56.000000000 +0200 @@ -38,14 +38,11 @@ assert response == mocked_response -recording_directory = tempfile.mkdtemp() - - @pytest.mark.skipif('os.getenv("SKIP_TRUE_HTTP", False)') def test_truesendall_with_recording_https(): with tempfile.TemporaryDirectory() as temp_dir: with Mocketizer(truesocket_recording_dir=temp_dir): - url = "https://httpbin.org/ip" + url = "https://mockbin.org/ip" requests.get(url, headers={"Accept": "application/json"}) resp = requests.get(url, headers={"Accept": "application/json"}) @@ -58,7 +55,7 @@ with io.open(dump_filename) as f: responses = json.load(f) - assert len(responses["httpbin.org"]["443"].keys()) == 1 + assert len(responses["mockbin.org"]["443"].keys()) == 1 @pytest.mark.skipif('os.getenv("SKIP_TRUE_HTTP", False)') @@ -66,7 +63,7 @@ Mocket.enable() Mocket.disable() - url = "https://httpbin.org/ip" + url = "https://mockbin.org/ip" resp = requests.get(url) assert resp.status_code == 200 @@ -75,7 +72,7 @@ def test_real_request_session(): session = requests.Session() - url1 = "https://httpbin.org/ip" + url1 = "https://mockbin.org/ip" url2 = "http://httpbin.org/headers" with Mocketizer(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/tests/main/test_httpx.py new/mocket-3.11.1/tests/main/test_httpx.py --- old/mocket-3.11.0/tests/main/test_httpx.py 1970-01-01 01:00:00.000000000 +0100 +++ new/mocket-3.11.1/tests/main/test_httpx.py 2023-02-21 22:35:00.000000000 +0100 @@ -0,0 +1,60 @@ +import json + +import aiohttp +import httpx +import pytest +from asgiref.sync import async_to_sync + +from mocket.mocket import Mocket, mocketize +from mocket.mockhttp import Entry +from mocket.plugins.httpretty import httprettified, httpretty + +timeout = aiohttp.ClientTimeout(total=3) + + +@mocketize [email protected]("url", ["http://httpbin.org/ip", "https://httpbin.org/ip"]) +def test_body(url): + body = "asd" * 100 + Entry.single_register(Entry.GET, url, body=body, status=404) + Entry.single_register(Entry.POST, url, body=body * 2, status=201) + + @async_to_sync + async def perform_async_transactions(): + async with httpx.AsyncClient() as client: + response = await client.get(url) + assert response.status_code == 404 + assert response.text == body + + response = await client.post(url, data=body * 6) + assert response.status_code == 201 + assert response.text == body * 2 + + assert Mocket.last_request().method == "POST" + assert Mocket.last_request().body == body * 6 + + perform_async_transactions() + assert len(Mocket.request_list()) == 2 + + +@httprettified +def test_httprettish_session(): + url = "https://httpbin.org/ip" + + expected_response = {"origin": "127.0.0.2"} + + httpretty.register_uri( + httpretty.GET, + url, + body=json.dumps(expected_response), + ) + + @async_to_sync + async def perform_async_transactions(): + async with httpx.AsyncClient() as client: + response = await client.get(url) + assert response.status_code == 200 + assert response.json() == expected_response + + perform_async_transactions() + assert len(httpretty.latest_requests) == 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/tests/main/test_mode.py new/mocket-3.11.1/tests/main/test_mode.py --- old/mocket-3.11.0/tests/main/test_mode.py 2023-02-19 12:01:29.000000000 +0100 +++ new/mocket-3.11.1/tests/main/test_mode.py 2023-05-12 12:31:56.000000000 +0200 @@ -7,7 +7,7 @@ @mocketize(strict_mode=True) def test_strict_mode_fails(): - url = "https://httpbin.org/ip" + url = "http://httpbin.local/ip" with pytest.raises(StrictMocketException): requests.get(url) @@ -15,7 +15,7 @@ @pytest.mark.skipif('os.getenv("SKIP_TRUE_HTTP", False)') def test_intermittent_strict_mode(): - url = "https://httpbin.org/ip" + url = "http://httpbin.local/ip" with Mocketizer(strict_mode=False): requests.get(url) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/tests/main/tests.main.test_http.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json new/mocket-3.11.1/tests/main/tests.main.test_http.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json --- old/mocket-3.11.0/tests/main/tests.main.test_http.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json 2023-02-19 12:01:29.000000000 +0100 +++ new/mocket-3.11.1/tests/main/tests.main.test_http.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json 2023-05-12 12:31:56.000000000 +0200 @@ -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 C E 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/tests/main/tests.main.test_http_gevent.GeventHttpEntryTestCase.test_truesendall_with_dump_from_recording.json new/mocket-3.11.1/tests/main/tests.main.test_http_gevent.GeventHttpEntryTestCase.test_truesendall_with_dump_from_recording.json --- old/mocket-3.11.0/tests/main/tests.main.test_http_gevent.GeventHttpEntryTestCase.test_truesendall_with_dump_from_recording.json 2023-02-19 12:01:29.000000000 +0100 +++ new/mocket-3.11.1/tests/main/tests.main.test_http_gevent.GeventHttpEntryTestCase.test_truesendall_with_dump_from_recording.json 2023-05-12 12:31:56.000000000 +0200 @@ -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 2 2 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 C E 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/tests/main/tests.main.test_http_with_xxhash.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json new/mocket-3.11.1/tests/main/tests.main.test_http_with_xxhash.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json --- old/mocket-3.11.0/tests/main/tests.main.test_http_with_xxhash.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json 2023-02-19 12:01:29.000000000 +0100 +++ new/mocket-3.11.1/tests/main/tests.main.test_http_with_xxhash.HttpEntryTestCase.test_truesendall_with_dump_from_recording.json 2023-05-12 12:31:56.000000000 +0200 @@ -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 C E 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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocket-3.11.0/tests/tests38/test_http_aiohttp.py new/mocket-3.11.1/tests/tests38/test_http_aiohttp.py --- old/mocket-3.11.0/tests/tests38/test_http_aiohttp.py 2023-02-19 16:55:48.000000000 +0100 +++ new/mocket-3.11.1/tests/tests38/test_http_aiohttp.py 2023-05-12 12:31:56.000000000 +0200 @@ -13,7 +13,7 @@ class AioHttpEntryTestCase(IsolatedAsyncioTestCase): timeout = aiohttp.ClientTimeout(total=3) - target_url = "http://httpbin.org/ip" + target_url = "http://httpbin.local/ip" @async_mocketize async def test_http_session(self):
