Refresh current connection when toggling autodecode.
Also fix the unit tests I forgot to commit...
This commit is contained in:
parent
8cc0469ee7
commit
a817db5bd6
|
@ -1728,6 +1728,7 @@ class ConsoleMaster(flow.FlowMaster):
|
|||
self.anticomp = not self.anticomp
|
||||
elif a == "d":
|
||||
self.autodecode = not self.autodecode
|
||||
self.refresh_connection(self.currentflow)
|
||||
elif a == "k":
|
||||
self.killextra = not self.killextra
|
||||
elif a == "n":
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue