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
5 changed files
with
97 additions
and
187 deletions.
There are no files selected for viewing
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,19 +1,17 @@ | ||
import aiohttp | ||
import aiohttp_mako | ||
|
||
|
||
def test_func(loop, create_server): | ||
async def test_func(app, test_client): | ||
|
||
@aiohttp_mako.template('tplt.html') | ||
async def func(request): | ||
return {'head': 'HEAD', 'text': 'text'} | ||
|
||
async def go(): | ||
app, url = await create_server() | ||
app.router.add_route('GET', '/', func) | ||
app.router.add_route('GET', '/', func) | ||
|
||
resp = await aiohttp.request('GET', url, loop=loop) | ||
assert 200 == resp.status | ||
txt = await resp.text() | ||
assert '<html><body><h1>HEAD</h1>text</body></html>' == txt | ||
loop.run_until_complete(go()) | ||
client = await test_client(app) | ||
|
||
resp = await client.get('/') | ||
assert 200 == resp.status | ||
txt = await resp.text() | ||
assert '<html><body><h1>HEAD</h1>text</body></html>' == txt |
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