Skip to content

Commit

Permalink
uprev and index.html test
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Nov 28, 2016
1 parent 5623c5f commit 06292bc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
1 change: 0 additions & 1 deletion aiohttp_devtools/runserver/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ def __init__(self, *args, **kwargs):
self._asset_path = None # TODO
tail_snippet = kwargs.pop('tail_snippet')
super().__init__(*args, **kwargs)
print('prefix', repr(self._prefix))
self._show_index = True
if tail_snippet:
self._file_sender = CustomFileSender(
Expand Down
2 changes: 1 addition & 1 deletion aiohttp_devtools/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__all__ = ['VERSION']

VERSION = StrictVersion('0.0.2')
VERSION = StrictVersion('0.0.3')
14 changes: 14 additions & 0 deletions tests/test_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,17 @@ async def test_html_file_livereload(loop, test_client, tmpworkdir):
assert r.headers['content-type'] == 'application/javascript'
text = await r.text()
assert text.startswith('(function e(t,n,r){')


async def test_serve_index(loop, test_client, tmpworkdir):
app, observer, port = serve_static(static_path=str(tmpworkdir), livereload=False, loop=loop)
assert port == 8000
cli = await test_client(app)
mktree(tmpworkdir, {
'index.html': '<h1>hello index</h1>',
})
r = await cli.get('/')
assert r.status == 200
assert r.headers['content-type'] == 'text/html'
text = await r.text()
assert text == '<h1>hello index</h1>'

0 comments on commit 06292bc

Please sign in to comment.