diff options
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") + |