aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-08-02 20:47:53 +1200
committerAldo Cortesi <aldo@nullcube.com>2011-08-02 20:47:53 +1200
commita817db5bd6b55cfb86de24cf7bc8aa8bb400653d (patch)
tree68b6fe785e84cc0eccd3ba3f61a53f57c2e42262 /test
parent8cc0469ee72592d079750a9d5427853d95a7dbfe (diff)
downloadmitmproxy-a817db5bd6b55cfb86de24cf7bc8aa8bb400653d.tar.gz
mitmproxy-a817db5bd6b55cfb86de24cf7bc8aa8bb400653d.tar.bz2
mitmproxy-a817db5bd6b55cfb86de24cf7bc8aa8bb400653d.zip
Refresh current connection when toggling autodecode.
Also fix the unit tests I forgot to commit...
Diffstat (limited to 'test')
-rw-r--r--test/test_encoding.py3
-rw-r--r--test/test_proxy.py8
2 files changed, 5 insertions, 6 deletions
diff --git a/test/test_encoding.py b/test/test_encoding.py
index dff146ee..d9e6a85c 100644
--- a/test/test_encoding.py
+++ b/test/test_encoding.py
@@ -10,8 +10,7 @@ class uidentity(libpry.AutoTree):
assert "string" == encoding.encode("identity", "string")
def test_fallthrough(self):
- assert "string" == encoding.decode("nonexistent encoding", "string")
- assert "string" == encoding.encode("nonexistent encoding", "string")
+ assert None == encoding.decode("nonexistent encoding", "string")
class ugzip(libpry.AutoTree):
def test_simple(self):
diff --git a/test/test_proxy.py b/test/test_proxy.py
index 340a68d7..83898d11 100644
--- a/test/test_proxy.py
+++ b/test/test_proxy.py
@@ -143,7 +143,7 @@ class uRequest(libpry.AutoTree):
r.headers["content-encoding"] = ["identity"]
r.content = "falafel"
r.decode()
- assert r.headers["content-encoding"] == ["identity"]
+ assert not r.headers["content-encoding"]
assert r.content == "falafel"
r = tutils.treq()
@@ -160,7 +160,7 @@ class uRequest(libpry.AutoTree):
assert r.headers["content-encoding"] == ["gzip"]
assert r.content != "falafel"
r.decode()
- assert r.headers["content-encoding"] == ["identity"]
+ assert not r.headers["content-encoding"]
assert r.content == "falafel"
@@ -233,7 +233,7 @@ class uResponse(libpry.AutoTree):
r.headers["content-encoding"] = ["identity"]
r.content = "falafel"
r.decode()
- assert r.headers["content-encoding"] == ["identity"]
+ assert not r.headers["content-encoding"]
assert r.content == "falafel"
r = tutils.tresp()
@@ -250,7 +250,7 @@ class uResponse(libpry.AutoTree):
assert r.headers["content-encoding"] == ["gzip"]
assert r.content != "falafel"
r.decode()
- assert r.headers["content-encoding"] == ["identity"]
+ assert not r.headers["content-encoding"]
assert r.content == "falafel"