From 2cb7429d38243d95664791d3edd7c4894efd6ee9 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Thu, 3 Feb 2011 14:51:32 +1300 Subject: Change "connection" to the less confusing "client_conn" throughout. --- test/test_console.py | 12 ++++++------ test/test_filt.py | 2 +- test/test_flow.py | 16 ++++++++-------- test/test_proxy.py | 8 ++++---- test/utils.py | 4 ++-- 5 files changed, 21 insertions(+), 21 deletions(-) (limited to 'test') diff --git a/test/test_console.py b/test/test_console.py index 98a1270f..5b1364a5 100644 --- a/test/test_console.py +++ b/test/test_console.py @@ -10,7 +10,7 @@ class uState(libpry.AutoTree): connect -> request -> response """ - bc = proxy.BrowserConnection("address", 22) + bc = proxy.ClientConnection("address", 22) c = console.ConsoleState() f = flow.Flow(bc) c.add_browserconnect(f) @@ -25,7 +25,7 @@ class uState(libpry.AutoTree): """ c = console.ConsoleState() - bc = proxy.BrowserConnection("address", 22) + bc = proxy.ClientConnection("address", 22) f = flow.Flow(bc) c.add_browserconnect(f) assert c.get_focus() == (f, 0) @@ -33,7 +33,7 @@ class uState(libpry.AutoTree): assert c.get_from_pos(1) == (None, None) assert c.get_next(0) == (None, None) - bc2 = proxy.BrowserConnection("address", 22) + bc2 = proxy.ClientConnection("address", 22) f2 = flow.Flow(bc2) c.add_browserconnect(f2) assert c.get_focus() == (f, 1) @@ -54,7 +54,7 @@ class uState(libpry.AutoTree): def _add_request(self, state): f = utils.tflow() state.add_browserconnect(f) - q = utils.treq(f.connection) + q = utils.treq(f.client_conn) state.add_request(q) return f @@ -67,7 +67,7 @@ class uState(libpry.AutoTree): c = console.ConsoleState() f = utils.tflow() c.add_browserconnect(f) - q = utils.treq(f.connection) + q = utils.treq(f.client_conn) c.focus = None assert c.add_request(q) @@ -117,7 +117,7 @@ class uformat_flow(libpry.AutoTree): assert ('method', '[edited] ') in console.format_flow(f, True) assert ('method', '[edited] ') in console.format_flow(f, True, True) - f.connection = flow.ReplayConnection() + f.client_conn = flow.ReplayConnection() assert ('method', '[replay] ') in console.format_flow(f, True) assert ('method', '[replay] ') in console.format_flow(f, True, True) diff --git a/test/test_filt.py b/test/test_filt.py index 036c1892..b25058c5 100644 --- a/test/test_filt.py +++ b/test/test_filt.py @@ -72,7 +72,7 @@ class uParsing(libpry.AutoTree): class uMatching(libpry.AutoTree): def req(self): - conn = proxy.BrowserConnection("one", 2222) + conn = proxy.ClientConnection("one", 2222) headers = utils.Headers() headers["header"] = ["qvalue"] return proxy.Request( diff --git a/test/test_flow.py b/test/test_flow.py index 59b277e4..61d6d56b 100644 --- a/test/test_flow.py +++ b/test/test_flow.py @@ -66,7 +66,7 @@ class uFlow(libpry.AutoTree): assert console.format_flow(f, True) assert console.format_flow(f, False) - f.connection = flow.ReplayConnection() + f.client_conn = flow.ReplayConnection() assert console.format_flow(f, True) assert console.format_flow(f, False) @@ -115,7 +115,7 @@ class uFlow(libpry.AutoTree): class uState(libpry.AutoTree): def test_backup(self): - bc = proxy.BrowserConnection("address", 22) + bc = proxy.ClientConnection("address", 22) c = flow.State() f = flow.Flow(bc) c.add_browserconnect(f) @@ -129,7 +129,7 @@ class uState(libpry.AutoTree): connect -> request -> response """ - bc = proxy.BrowserConnection("address", 22) + bc = proxy.ClientConnection("address", 22) c = flow.State() f = flow.Flow(bc) c.add_browserconnect(f) @@ -154,14 +154,14 @@ class uState(libpry.AutoTree): assert not c.lookup(newresp) def test_err(self): - bc = proxy.BrowserConnection("address", 22) + bc = proxy.ClientConnection("address", 22) c = flow.State() f = flow.Flow(bc) c.add_browserconnect(f) e = proxy.Error(bc, "message") assert c.add_error(e) - e = proxy.Error(proxy.BrowserConnection("address", 22), "message") + e = proxy.Error(proxy.ClientConnection("address", 22), "message") assert not c.add_error(e) def test_view(self): @@ -176,7 +176,7 @@ class uState(libpry.AutoTree): f = utils.tflow() - req = utils.treq(f.connection) + req = utils.treq(f.client_conn) c.add_browserconnect(f) c.add_request(req) assert len(c.view) == 2 @@ -188,7 +188,7 @@ class uState(libpry.AutoTree): def _add_request(self, state): f = utils.tflow() state.add_browserconnect(f) - q = utils.treq(f.connection) + q = utils.treq(f.client_conn) state.add_request(q) return f @@ -201,7 +201,7 @@ class uState(libpry.AutoTree): f = utils.tflow() f.error = proxy.Error(None, "msg") state.add_browserconnect(f) - q = utils.treq(f.connection) + q = utils.treq(f.client_conn) state.add_request(q) def test_kill_flow(self): diff --git a/test/test_proxy.py b/test/test_proxy.py index eaf73ee1..5a057485 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -221,7 +221,7 @@ class uRequest(libpry.AutoTree): def test_simple(self): h = utils.Headers() h["test"] = ["test"] - c = proxy.BrowserConnection("addr", 2222) + c = proxy.ClientConnection("addr", 2222) r = proxy.Request(c, "host", 22, "https", "GET", "/", h, "content") u = r.url() assert r.set_url(u) @@ -233,7 +233,7 @@ class uRequest(libpry.AutoTree): def test_getset_state(self): h = utils.Headers() h["test"] = ["test"] - c = proxy.BrowserConnection("addr", 2222) + 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 @@ -243,7 +243,7 @@ class uResponse(libpry.AutoTree): def test_simple(self): h = utils.Headers() h["test"] = ["test"] - c = proxy.BrowserConnection("addr", 2222) + c = proxy.ClientConnection("addr", 2222) req = proxy.Request(c, "host", 22, "https", "GET", "/", h, "content") resp = proxy.Response(req, 200, "HTTP", "msg", h.copy(), "content") assert resp.short() @@ -252,7 +252,7 @@ class uResponse(libpry.AutoTree): def test_getset_state(self): h = utils.Headers() h["test"] = ["test"] - c = proxy.BrowserConnection("addr", 2222) + c = proxy.ClientConnection("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, "HTTP", "msg", h.copy(), "content") diff --git a/test/utils.py b/test/utils.py index d07cb658..07145d6b 100644 --- a/test/utils.py +++ b/test/utils.py @@ -2,7 +2,7 @@ from libmproxy import proxy, utils, filt, flow def treq(conn=None): if not conn: - conn = proxy.BrowserConnection("address", 22) + conn = proxy.ClientConnection("address", 22) headers = utils.Headers() headers["header"] = ["qvalue"] return proxy.Request(conn, "host", 80, "http", "GET", "/path", headers, "content") @@ -17,6 +17,6 @@ def tresp(req=None): def tflow(): - bc = proxy.BrowserConnection("address", 22) + bc = proxy.ClientConnection("address", 22) return flow.Flow(bc) -- cgit v1.2.3