Skip to content

Commit

Permalink
Fix for tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
mindflayer committed Sep 16, 2024
1 parent 6660c03 commit 2584e22
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
3 changes: 2 additions & 1 deletion mocket/mocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def __set__(self, *args):
minimum_version = FakeSetter()
options = FakeSetter()
verify_mode = FakeSetter()
verify_flags = FakeSetter()


class FakeSSLContext(SuperFakeSSLContext):
Expand All @@ -102,7 +103,7 @@ def check_hostname(self):
return self._check_hostname

@check_hostname.setter
def check_hostname(self, *args):
def check_hostname(self, _):
self._check_hostname = False

def __init__(self, sock=None, server_hostname=None, _context=None, *args, **kwargs):
Expand Down
12 changes: 10 additions & 2 deletions tests/main/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,18 @@ 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.local/ip", headers={"user-agent": "Fake-User-Agent"}
"http://httpbin.local/ip",
headers={
"user-agent": "Fake-User-Agent",
"Accept-Encoding": "gzip, deflate, zstd",
},
)
requests.get(
"http://httpbin.local/gzip", headers={"user-agent": "Fake-User-Agent"}
"http://httpbin.local/gzip",
headers={
"user-agent": "Fake-User-Agent",
"Accept-Encoding": "gzip, deflate, zstd",
},
)

dump_filename = os.path.join(
Expand Down
12 changes: 10 additions & 2 deletions tests/main/test_http_with_xxhash.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@ class HttpEntryTestCase(HttpTestCase):
@mocketize(truesocket_recording_dir=os.path.dirname(__file__))
def test_truesendall_with_dump_from_recording(self):
requests.get(
"http://httpbin.local/ip", headers={"user-agent": "Fake-User-Agent"}
"http://httpbin.local/ip",
headers={
"user-agent": "Fake-User-Agent",
"Accept-Encoding": "gzip, deflate, zstd",
},
)
requests.get(
"http://httpbin.local/gzip", headers={"user-agent": "Fake-User-Agent"}
"http://httpbin.local/gzip",
headers={
"user-agent": "Fake-User-Agent",
"Accept-Encoding": "gzip, deflate, zstd",
},
)

dump_filename = os.path.join(
Expand Down

0 comments on commit 2584e22

Please sign in to comment.