aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2015-05-30 17:43:01 +1200
committerAldo Cortesi <aldo@nullcube.com>2015-05-30 17:43:01 +1200
commita09f3e06c36f440b9975cbdb8379734eae9f47cc (patch)
tree51758aa1fb09962f64cbd46ff07ebe37f0fcc07e /test
parent4ed5043c67848bf717e48bc509d959422c8faeb6 (diff)
downloadmitmproxy-a09f3e06c36f440b9975cbdb8379734eae9f47cc.tar.gz
mitmproxy-a09f3e06c36f440b9975cbdb8379734eae9f47cc.tar.bz2
mitmproxy-a09f3e06c36f440b9975cbdb8379734eae9f47cc.zip
Factor logger out of pathoc, use it in pathod as well.
Diffstat (limited to 'test')
-rw-r--r--test/test_language_base.py2
-rw-r--r--test/test_pathod.py4
-rw-r--r--test/test_utils.py2
3 files changed, 5 insertions, 3 deletions
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():