Skip to content

Commit

Permalink
refactor: get rid of some type hint related warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-sipgate committed Nov 28, 2023
1 parent f85d12b commit 28a7507
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions http_request_recorder/http_request_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, matcher, responses: ResponsesType, name: str, timeout: int):
elif isinstance(responses, Iterable):
self.responses = map(ExpectedInteraction.SingleRequest, responses)
if hasattr(responses, "__len__"):
self.expected_count = len(responses)
self.expected_count = sum(1 for _ in responses)
else:
raise TypeError("responses must be str | bytes | web.Response | Iterable[str] | Iterable[bytes] | Iterable[web.Response]")

Expand All @@ -60,7 +60,7 @@ def __init__(self, matcher, responses: ResponsesType, name: str, timeout: int):
def __repr__(self):
return f"<{self.__class__.__name__} '{self.name}'>"

def record_once(self, request_body: str):
def record_once(self, request_body: bytes):
for_response = next(self._next_for_response)
for_response.request = request_body
for_response.was_triggered.set()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name='http_request_recorder',
version='0.2.0',
version='0.2.1',
description='A package to record an respond to http requests, primarily for use in black box testing.',
long_description=readme,
author='',
Expand Down

0 comments on commit 28a7507

Please sign in to comment.