Skip to content

Commit

Permalink
fmt_size tests, extend check_server_running and HISTORY
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Feb 11, 2017
1 parent 0b72ead commit 6c481f5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
History
-------

0.1.4 (2017-02-11)
------------------
* resolve conflicts with aiohttp 1.3.0
* test build matrix to test with all recent version of aiohttp and master
* dependency updates
* fix for `fmt_size` with size is ``None``

0.1.3 (2017-01-18)
------------------
* add ``app.cleanup()`` to pre-checks
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.1.3')
VERSION = StrictVersion('0.1.4')
2 changes: 1 addition & 1 deletion tests/test_runserver_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

async def check_server_running(loop, *, live_reload, check_errors=False):
port_open = False
for i in range(30):
for i in range(50):
try:
await loop.create_connection(lambda: asyncio.Protocol(), host='localhost', port=8000)
except OSError:
Expand Down
11 changes: 11 additions & 0 deletions tests/test_runserver_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pytest

from aiohttp_devtools.exceptions import AiohttpDevException
from aiohttp_devtools.runserver.log_handlers import fmt_size
from aiohttp_devtools.runserver.serve import AuxiliaryApplication, check_port_open


Expand Down Expand Up @@ -96,3 +97,13 @@ async def test_aux_cleanup(loop):
aux_app['websockets'] = [(ws, '/foo/bar')]
await aux_app.cleanup()
assert ws.close.call_count == 1


@pytest.mark.parametrize('value,result', [
(None, ''),
('', ''),
(1000, '1000B'),
(2000, '2.0KB'),
])
def test_fmt_size_large(value, result):
assert fmt_size(value) == result

0 comments on commit 6c481f5

Please sign in to comment.