From d0c2d9480cdf80c680937c97c790add902f718fa Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 6 Feb 2011 10:28:43 +1300 Subject: Also serialize ClientConnection and flow backups. --- test/test_flow.py | 5 +++++ test/test_proxy.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/test_flow.py b/test/test_flow.py index 9629934f..b71ce6af 100644 --- a/test/test_flow.py +++ b/test/test_flow.py @@ -32,10 +32,15 @@ class uFlow(libpry.AutoTree): def test_backup(self): f = utils.tflow() + f.response = utils.tresp() + f.request = f.response.request + f.request.content = "foo" assert not f.modified() f.backup() + f.request.content = "bar" assert f.modified() f.revert() + assert f.request.content == "foo" def test_getset_state(self): f = utils.tflow() diff --git a/test/test_proxy.py b/test/test_proxy.py index 340b6697..e343e693 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -236,7 +236,7 @@ class uRequest(libpry.AutoTree): c = proxy.ClientConnection(("addr", 2222)) r = proxy.Request(c, "host", 22, "https", "GET", "/", h, "content") state = r.get_state() - assert proxy.Request.from_state(state) == r + assert proxy.Request.from_state(c, state) == r class uResponse(libpry.AutoTree): -- cgit v1.2.3