diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-06-16 13:38:10 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-06-16 13:38:10 +1200 |
commit | 4e53f1ee908949c0dcafd822bf05f9523e00d189 (patch) | |
tree | 856844675103ae220209be8911dd8d1cb7358b53 /test | |
parent | 8ae64337ed64b0dc85aeba92ed23d038466ff6f7 (diff) | |
download | mitmproxy-4e53f1ee908949c0dcafd822bf05f9523e00d189.tar.gz mitmproxy-4e53f1ee908949c0dcafd822bf05f9523e00d189.tar.bz2 mitmproxy-4e53f1ee908949c0dcafd822bf05f9523e00d189.zip |
Rename our tcpserver to netlib, expand to include client network functions.
Diffstat (limited to 'test')
-rw-r--r-- | test/test_netlib.py | 15 | ||||
-rw-r--r-- | test/test_proxy.py | 11 |
2 files changed, 15 insertions, 11 deletions
diff --git a/test/test_netlib.py b/test/test_netlib.py new file mode 100644 index 00000000..2b76c9cf --- /dev/null +++ b/test/test_netlib.py @@ -0,0 +1,15 @@ +import cStringIO +from libmproxy import netlib + + +class TestFileLike: + def test_wrap(self): + s = cStringIO.StringIO("foobar\nfoobar") + s = netlib.FileLike(s) + s.flush() + assert s.readline() == "foobar\n" + assert s.readline() == "foobar" + # Test __getattr__ + assert s.isatty + + diff --git a/test/test_proxy.py b/test/test_proxy.py index 9d7239dd..5fab282c 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -60,17 +60,6 @@ def test_read_http_body(): assert len(proxy.read_http_body(s, h, True, 100)) == 7 -class TestFileLike: - def test_wrap(self): - s = cStringIO.StringIO("foobar\nfoobar") - s = proxy.FileLike(s) - s.flush() - assert s.readline() == "foobar\n" - assert s.readline() == "foobar" - # Test __getattr__ - assert s.isatty - - class TestProxyError: def test_simple(self): p = proxy.ProxyError(111, "msg") |