-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
219 additions
and
149 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ flake8 | |
coverage | ||
nose | ||
asynctest | ||
autopep8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
dirty-loader >= 0.2.2 | ||
git+https://github.com/alfred82santa/configure.git | ||
aiohttp >= 3.1.1 | ||
configure-fork | ||
aiohttp >= 3.7.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,31 @@ | ||
from asyncio import get_event_loop | ||
from asyncio import Future, get_event_loop | ||
|
||
from aiohttp import ClientResponse, RequestInfo | ||
from aiohttp.helpers import TimerContext | ||
from yarl import URL | ||
|
||
|
||
async def create_fake_response(method, url, *, session, headers=None, loop=None): | ||
loop = loop or get_event_loop() | ||
|
||
try: | ||
from asyncio import create_task | ||
except ImportError: # pragma: no cover | ||
create_task = loop.create_task | ||
|
||
async def writer(*args, **kwargs): | ||
return None | ||
|
||
continue100 = Future() | ||
continue100.set_result(False) | ||
|
||
return ClientResponse(method, URL(url), | ||
writer=None, continue100=False, timer=None, | ||
request_info=RequestInfo(URL(url), method, | ||
writer=create_task(writer()), | ||
continue100=continue100, | ||
timer=TimerContext(loop=loop), | ||
request_info=RequestInfo(URL(url), | ||
method, | ||
headers or []), | ||
auto_decompress=False, | ||
traces=[], loop=loop or get_event_loop(), session=session) | ||
traces=[], | ||
loop=loop, | ||
session=session) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.