aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_encoding.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-06-09 13:42:43 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-06-09 13:42:43 +1200
commitb7b357528c3d3867f1a29400de3a11f2d976e60d (patch)
tree2312713e8c01d8532e2f5f12b31e97a3688eba15 /test/test_encoding.py
parenta63240a8483c0bbc52218380c0c70da46a29f75b (diff)
downloadmitmproxy-b7b357528c3d3867f1a29400de3a11f2d976e60d.tar.gz
mitmproxy-b7b357528c3d3867f1a29400de3a11f2d976e60d.tar.bz2
mitmproxy-b7b357528c3d3867f1a29400de3a11f2d976e60d.zip
Port mitmproxy test suite entirely to nose.
Diffstat (limited to 'test/test_encoding.py')
-rw-r--r--test/test_encoding.py35
1 files changed, 13 insertions, 22 deletions
diff --git a/test/test_encoding.py b/test/test_encoding.py
index 61caf507..732447e2 100644
--- a/test/test_encoding.py
+++ b/test/test_encoding.py
@@ -1,28 +1,19 @@
from libmproxy import encoding
-import libpry
-class uidentity(libpry.AutoTree):
- def test_simple(self):
- assert "string" == encoding.decode("identity", "string")
- assert "string" == encoding.encode("identity", "string")
- assert not encoding.encode("nonexistent", "string")
+def test_identity():
+ assert "string" == encoding.decode("identity", "string")
+ assert "string" == encoding.encode("identity", "string")
+ assert not encoding.encode("nonexistent", "string")
+ assert None == encoding.decode("nonexistent encoding", "string")
- def test_fallthrough(self):
- assert None == encoding.decode("nonexistent encoding", "string")
-class ugzip(libpry.AutoTree):
- def test_simple(self):
- assert "string" == encoding.decode("gzip", encoding.encode("gzip", "string"))
- assert None == encoding.decode("gzip", "bogus")
+def test_gzip():
+ assert "string" == encoding.decode("gzip", encoding.encode("gzip", "string"))
+ assert None == encoding.decode("gzip", "bogus")
-class udeflate(libpry.AutoTree):
- def test_simple(self):
- assert "string" == encoding.decode("deflate", encoding.encode("deflate", "string"))
- assert "string" == encoding.decode("deflate", encoding.encode("deflate", "string")[2:-4])
- assert None == encoding.decode("deflate", "bogus")
-tests = [
- uidentity(),
- ugzip(),
- udeflate()
-]
+def test_deflate():
+ assert "string" == encoding.decode("deflate", encoding.encode("deflate", "string"))
+ assert "string" == encoding.decode("deflate", encoding.encode("deflate", "string")[2:-4])
+ assert None == encoding.decode("deflate", "bogus")
+