From 5da27a9905302a5e43fdf4db8a7b7b784544bed2 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 19 Feb 2011 17:00:24 +1300 Subject: Refactor Flow primitives to remove HTTP1.0 assumption. This is a big patch removing the assumption that there's one connection per Request/Response pair. It touches pretty much every part of mitmproxy, so expect glitches until everything is ironed out. --- test/test_proxy.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/test_proxy.py') diff --git a/test/test_proxy.py b/test/test_proxy.py index 7bb608ae..ba9d9bfa 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -213,7 +213,7 @@ class uRequest(libpry.AutoTree): def test_simple(self): h = utils.Headers() h["test"] = ["test"] - c = proxy.ClientConnection(("addr", 2222)) + c = proxy.ClientConnect(("addr", 2222)) r = proxy.Request(c, "host", 22, "https", "GET", "/", h, "content") u = r.url() assert r.set_url(u) @@ -225,17 +225,17 @@ class uRequest(libpry.AutoTree): def test_getset_state(self): h = utils.Headers() h["test"] = ["test"] - c = proxy.ClientConnection(("addr", 2222)) + c = proxy.ClientConnect(("addr", 2222)) r = proxy.Request(c, "host", 22, "https", "GET", "/", h, "content") state = r.get_state() - assert proxy.Request.from_state(c, state) == r + assert proxy.Request.from_state(state) == r class uResponse(libpry.AutoTree): def test_simple(self): h = utils.Headers() h["test"] = ["test"] - c = proxy.ClientConnection(("addr", 2222)) + c = proxy.ClientConnect(("addr", 2222)) req = proxy.Request(c, "host", 22, "https", "GET", "/", h, "content") resp = proxy.Response(req, 200, "msg", h.copy(), "content") assert resp.short() @@ -244,7 +244,7 @@ class uResponse(libpry.AutoTree): def test_getset_state(self): h = utils.Headers() h["test"] = ["test"] - c = proxy.ClientConnection(("addr", 2222)) + c = proxy.ClientConnect(("addr", 2222)) r = proxy.Request(c, "host", 22, "https", "GET", "/", h, "content") req = proxy.Request(c, "host", 22, "https", "GET", "/", h, "content") resp = proxy.Response(req, 200, "msg", h.copy(), "content") -- cgit v1.2.3