Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use RequestInfo rather than a mock #154

Merged
merged 2 commits into from
Oct 28, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion aioresponses/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
merge_params,
normalize_url,
)
if AIOHTTP_VERSION >= StrictVersion('3.1.0'):
from aiohttp import RequestInfo
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from aiohttp import RequestInfo
in case of import error RequestInfo = Mock

hadrien marked this conversation as resolved.
Show resolved Hide resolved


class CallbackResult:
Expand Down Expand Up @@ -134,7 +136,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