From fc4fe83eafc68ebb9763fa5cbee1ed7e16964c9c Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 9 Mar 2014 21:13:08 +0100 Subject: split up proxy.py --- test/test_proxy.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test/test_proxy.py') diff --git a/test/test_proxy.py b/test/test_proxy.py index b15e3f84..2a4a250e 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -1,5 +1,7 @@ import argparse from libmproxy import proxy, flow, cmdline +from libmproxy.prxy.connection import ServerConnection +from libmproxy.prxy.exception import ProxyError import tutils from libpathod import test from netlib import http, tcp @@ -7,7 +9,7 @@ import mock def test_proxy_error(): - p = proxy.ProxyError(111, "msg") + p = ProxyError(111, "msg") assert str(p) @@ -19,7 +21,7 @@ class TestServerConnection: self.d.shutdown() def test_simple(self): - sc = proxy.ServerConnection((self.d.IFACE, self.d.port), None) + sc = ServerConnection((self.d.IFACE, self.d.port), None) sc.connect() r = tutils.treq() r.flow.server_conn = sc @@ -31,7 +33,7 @@ class TestServerConnection: sc.finish() def test_terminate_error(self): - sc = proxy.ServerConnection((self.d.IFACE, self.d.port), None) + sc = ServerConnection((self.d.IFACE, self.d.port), None) sc.connect() sc.connection = mock.Mock() sc.connection.recv = mock.Mock(return_value=False) -- cgit v1.2.3 From 5598a8de82f28232fb4407911a8643dceacc9ebc Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sun, 9 Mar 2014 21:51:24 +0100 Subject: finish proxy.py split up --- test/test_proxy.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'test/test_proxy.py') diff --git a/test/test_proxy.py b/test/test_proxy.py index 2a4a250e..f53aa762 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -1,7 +1,9 @@ import argparse -from libmproxy import proxy, flow, cmdline -from libmproxy.prxy.connection import ServerConnection -from libmproxy.prxy.exception import ProxyError +from libmproxy import cmdline +from libmproxy.proxy.config import process_proxy_options +from libmproxy.proxy.connection import ServerConnection +from libmproxy.proxy.primitives import ProxyError +from libmproxy.proxy.server import DummyServer, ProxyServer import tutils from libpathod import test from netlib import http, tcp @@ -58,7 +60,7 @@ class TestProcessProxyOptions: cmdline.common_options(parser) opts = parser.parse_args(args=args) m = MockParser() - return m, proxy.process_proxy_options(m, opts) + return m, process_proxy_options(m, opts) def assert_err(self, err, *args): m, p = self.p(*args) @@ -117,12 +119,12 @@ class TestProxyServer: parser = argparse.ArgumentParser() cmdline.common_options(parser) opts = parser.parse_args(args=[]) - tutils.raises("error starting proxy server", proxy.ProxyServer, opts, 1) + tutils.raises("error starting proxy server", ProxyServer, opts, 1) class TestDummyServer: def test_simple(self): - d = proxy.DummyServer(None) + d = DummyServer(None) d.start_slave() d.shutdown() -- cgit v1.2.3