mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-04 22:55:19 +08:00
move encoding tests from mitmproxy to netlib
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
from libmproxy import encoding
|
||||
|
||||
|
||||
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_gzip():
|
||||
assert "string" == encoding.decode(
|
||||
"gzip",
|
||||
encoding.encode(
|
||||
"gzip",
|
||||
"string"))
|
||||
assert None == encoding.decode("gzip", "bogus")
|
||||
|
||||
|
||||
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")
|
||||
Reference in New Issue
Block a user