aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_netlib.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-06-16 13:38:10 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-06-16 13:38:10 +1200
commit4e53f1ee908949c0dcafd822bf05f9523e00d189 (patch)
tree856844675103ae220209be8911dd8d1cb7358b53 /test/test_netlib.py
parent8ae64337ed64b0dc85aeba92ed23d038466ff6f7 (diff)
downloadmitmproxy-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/test_netlib.py')
-rw-r--r--test/test_netlib.py15
1 files changed, 15 insertions, 0 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
+
+