Skip to content

Commit

Permalink
Merge pull request #154 from hadrien/chore/use-request-info
Browse files Browse the repository at this point in the history
chore: use RequestInfo rather than a mock
  • Loading branch information
pnuckowski authored Oct 28, 2021
2 parents 34df4d8 + e691292 commit 98549d4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion aioresponses/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
merge_params,
normalize_url,
)
if AIOHTTP_VERSION >= StrictVersion('3.1.0'):
try:
from aiohttp import RequestInfo
except ImportError:
RequestInfo = Mock()


class CallbackResult:
Expand Down Expand Up @@ -136,7 +141,7 @@ def _build_response(self, url: 'Union[URL, str]',
loop = Mock()
loop.get_debug = Mock()
loop.get_debug.return_value = True
kwargs['request_info'] = Mock(
kwargs['request_info'] = RequestInfo(
url=url,
method=method,
headers=CIMultiDictProxy(CIMultiDict(**request_headers)),
Expand Down

0 comments on commit 98549d4

Please sign in to comment.