diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-04-30 12:18:01 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-04-30 12:18:01 +1200 |
commit | 1c26516b1822d82e3b701539591a1d22831e0a19 (patch) | |
tree | 0fbfca08b9b25ccad33304359ac6a3dd78c54a0e /test | |
parent | 90dff4a8a15580cf3e86d29c6aba1f97410a0b89 (diff) | |
download | mitmproxy-1c26516b1822d82e3b701539591a1d22831e0a19.tar.gz mitmproxy-1c26516b1822d82e3b701539591a1d22831e0a19.tar.bz2 mitmproxy-1c26516b1822d82e3b701539591a1d22831e0a19.zip |
pretty_size now lives in netlib.utils
Diffstat (limited to 'test')
-rw-r--r-- | test/test_utils.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/test/test_utils.py b/test/test_utils.py index ea38b9a3..6b9262a0 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -1,5 +1,5 @@ import json -from libmproxy import utils, flow +from libmproxy import utils from netlib import odict import tutils @@ -9,9 +9,11 @@ utils.CERT_SLEEP_TIME = 0 def test_format_timestamp(): assert utils.format_timestamp(utils.timestamp()) + def test_format_timestamp_with_milli(): assert utils.format_timestamp_with_milli(utils.timestamp()) + def test_isBin(): assert not utils.isBin("testing\n\r") assert utils.isBin("testing\x01") @@ -31,13 +33,6 @@ def test_clean_hanging_newline(): assert utils.clean_hanging_newline("foo") == "foo" -def test_pretty_size(): - assert utils.pretty_size(100) == "100B" - assert utils.pretty_size(1024) == "1kB" - assert utils.pretty_size(1024 + (1024/2.0)) == "1.5kB" - assert utils.pretty_size(1024*1024) == "1MB" - - def test_pkg_data(): assert utils.pkg_data.path("console") tutils.raises("does not exist", utils.pkg_data.path, "nonexistent") @@ -135,7 +130,7 @@ def test_parse_size(): def test_parse_content_type(): p = utils.parse_content_type assert p("text/html") == ("text", "html", {}) - assert p("text") == None + assert p("text") is None v = p("text/html; charset=UTF-8") assert v == ('text', 'html', {'charset': 'UTF-8'}) @@ -146,4 +141,4 @@ def test_safe_subn(): def test_urlencode(): - assert utils.urlencode([('foo','bar')]) + assert utils.urlencode([('foo', 'bar')]) |