From a09f3e06c36f440b9975cbdb8379734eae9f47cc Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 30 May 2015 17:43:01 +1200 Subject: Factor logger out of pathoc, use it in pathod as well. --- test/test_language_base.py | 2 +- test/test_pathod.py | 4 +++- test/test_utils.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/test_language_base.py b/test/test_language_base.py index d59ee88b..020d68ed 100644 --- a/test/test_language_base.py +++ b/test/test_language_base.py @@ -85,7 +85,7 @@ class TestTokValueGenerate: v = base.TokValue.parseString("@10k")[0] assert v.bytes() == 10240 v = base.TokValue.parseString("@10g")[0] - assert v.bytes() == 1024**3 * 10 + assert v.bytes() == 1024 ** 3 * 10 v = base.TokValue.parseString("@10g,digits")[0] assert v.datatype == "digits" diff --git a/test/test_pathod.py b/test/test_pathod.py index 7f07c041..5ff3e68c 100644 --- a/test/test_pathod.py +++ b/test/test_pathod.py @@ -1,3 +1,4 @@ +import cStringIO from libpathod import pathod, version from netlib import tcp, http import tutils @@ -5,7 +6,8 @@ import tutils class TestPathod(object): def test_logging(self): - p = pathod.Pathod(("127.0.0.1", 0)) + s = cStringIO.StringIO() + p = pathod.Pathod(("127.0.0.1", 0), logfp=s) assert len(p.get_log()) == 0 id = p.add_log(dict(s="foo")) assert p.log_by_id(id) diff --git a/test/test_utils.py b/test/test_utils.py index 2a158a07..7d24e9e4 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -20,7 +20,7 @@ def test_parse_size(): def test_parse_anchor_spec(): assert utils.parse_anchor_spec("foo=200") == ("foo", "200") - assert utils.parse_anchor_spec("foo") == None + assert utils.parse_anchor_spec("foo") is None def test_data_path(): -- cgit v1.2.3