aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_proxy.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/test_proxy.py b/test/test_proxy.py
index ffd29a73..1e68fd3d 100644
--- a/test/test_proxy.py
+++ b/test/test_proxy.py
@@ -203,6 +203,31 @@ class uResponse(libpry.AutoTree):
assert not "foo" in r.content
assert r.headers["boo"] == ["boo"]
+ def test_decodeencode(self):
+ r = tutils.tresp()
+ r.headers["content-encoding"] = ["identity"]
+ r.content = "falafel"
+ r.decode()
+ assert r.headers["content-encoding"] == ["identity"]
+ assert r.content == "falafel"
+
+ r = tutils.tresp()
+ r.headers["content-encoding"] = ["identity"]
+ r.content = "falafel"
+ r.encode("identity")
+ assert r.headers["content-encoding"] == ["identity"]
+ assert r.content == "falafel"
+
+ r = tutils.tresp()
+ r.headers["content-encoding"] = ["identity"]
+ r.content = "falafel"
+ r.encode("gzip")
+ assert r.headers["content-encoding"] == ["gzip"]
+ assert r.content != "falafel"
+ r.decode()
+ assert r.headers["content-encoding"] == ["identity"]
+ assert r.content == "falafel"
+
class uError(libpry.AutoTree):
def test_getset_state(self):