diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-06-09 13:42:43 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-06-09 13:42:43 +1200 |
commit | b7b357528c3d3867f1a29400de3a11f2d976e60d (patch) | |
tree | 2312713e8c01d8532e2f5f12b31e97a3688eba15 /test/test_encoding.py | |
parent | a63240a8483c0bbc52218380c0c70da46a29f75b (diff) | |
download | mitmproxy-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.py | 35 |
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") + |