aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorThomas Kriechbaumer <Kriechi@users.noreply.github.com>2016-09-06 20:29:59 +0200
committerGitHub <noreply@github.com>2016-09-06 20:29:59 +0200
commit7841d73cb2f1be5e0fdf7c40c247f7ea68b0c945 (patch)
tree7a500b8db86562055a552d1564f2ff605487f8f7 /test
parentc76d83f749079b88a2b7b7a76545a7d571ed96a5 (diff)
parent5728a1c900dc566cd9cce728266204572c486d8a (diff)
downloadmitmproxy-7841d73cb2f1be5e0fdf7c40c247f7ea68b0c945.tar.gz
mitmproxy-7841d73cb2f1be5e0fdf7c40c247f7ea68b0c945.tar.bz2
mitmproxy-7841d73cb2f1be5e0fdf7c40c247f7ea68b0c945.zip
Merge pull request #1531 from Schamper/encoding-patch
Fix decoding when content-encoding: none
Diffstat (limited to 'test')
-rw-r--r--test/netlib/test_encoding.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/netlib/test_encoding.py b/test/netlib/test_encoding.py
index 797abff2..e1175ef0 100644
--- a/test/netlib/test_encoding.py
+++ b/test/netlib/test_encoding.py
@@ -4,9 +4,13 @@ import pytest
from netlib import encoding, tutils
-def test_identity():
- assert b"string" == encoding.decode(b"string", "identity")
- assert b"string" == encoding.encode(b"string", "identity")
+@pytest.mark.parametrize("encoder", [
+ 'identity',
+ 'none',
+])
+def test_identity(encoder):
+ assert b"string" == encoding.decode(b"string", encoder)
+ assert b"string" == encoding.encode(b"string", encoder)
with tutils.raises(ValueError):
encoding.encode(b"string", "nonexistent encoding")