diff --git a/test/serv.py b/test/serv.py index f6dee2cc6..a89e60d64 100644 --- a/test/serv.py +++ b/test/serv.py @@ -1,5 +1,3 @@ -import socket -from SocketServer import BaseServer from BaseHTTPServer import HTTPServer import handler diff --git a/test/test_console.py b/test/test_console.py index cad613220..f8850590c 100644 --- a/test/test_console.py +++ b/test/test_console.py @@ -1,4 +1,4 @@ -from libmproxy import console, filt, flow +from libmproxy import console from libmproxy.console import common import tutils import libpry diff --git a/test/test_dump.py b/test/test_dump.py index 317d628a6..e7874841f 100644 --- a/test/test_dump.py +++ b/test/test_dump.py @@ -1,7 +1,7 @@ import os from cStringIO import StringIO import libpry -from libmproxy import dump, flow, proxy +from libmproxy import dump, flow import tutils class uStrFuncs(libpry.AutoTree): diff --git a/test/test_encoding.py b/test/test_encoding.py index 6ebe71723..61caf507b 100644 --- a/test/test_encoding.py +++ b/test/test_encoding.py @@ -1,8 +1,6 @@ from libmproxy import encoding import libpry -import cStringIO - class uidentity(libpry.AutoTree): def test_simple(self): assert "string" == encoding.decode("identity", "string") diff --git a/test/test_flow.py b/test/test_flow.py index ab92d130e..4cbd5e736 100644 --- a/test/test_flow.py +++ b/test/test_flow.py @@ -1,7 +1,7 @@ -import Queue, time, textwrap +import Queue, time from cStringIO import StringIO import email.utils -from libmproxy import console, proxy, filt, flow, controller, utils +from libmproxy import filt, flow, controller, utils import tutils import libpry @@ -472,7 +472,7 @@ class uFlowMaster(libpry.AutoTree): assert not fm.load_script("scripts/reqerr.py") req = tutils.treq() fm.handle_clientconnect(req.client_conn) - f = fm.handle_request(req) + assert fm.handle_request(req) def test_script(self): s = flow.State() diff --git a/test/test_proxy.py b/test/test_proxy.py index 8120bbbe2..22bcb6d4b 100644 --- a/test/test_proxy.py +++ b/test/test_proxy.py @@ -1,7 +1,7 @@ -import cStringIO, time, textwrap +import cStringIO, textwrap from cStringIO import StringIO import libpry -from libmproxy import proxy, controller, utils, dump, flow +from libmproxy import proxy, flow class u_read_chunked(libpry.AutoTree): diff --git a/test/test_server.py b/test/test_server.py index b000cc463..50f1afe86 100644 --- a/test/test_server.py +++ b/test/test_server.py @@ -1,5 +1,4 @@ import urllib, urllib2 -from libmproxy import flow import tutils class uSanity(tutils.ProxTest): diff --git a/test/test_utils.py b/test/test_utils.py index 510dbd597..c2f81a7b8 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -1,4 +1,4 @@ -import textwrap, cStringIO, os, time, re, json +import textwrap, os, re, json import libpry from libmproxy import utils @@ -205,8 +205,8 @@ class u_parse_proxy_spec(libpry.AutoTree): assert not utils.parse_proxy_spec("") assert utils.parse_proxy_spec("http://foo.com:88") == ("http", "foo.com", 88) assert utils.parse_proxy_spec("http://foo.com") == ("http", "foo.com", 80) - assert not utils.parse_proxy_spec("foo.com") - assert not utils.parse_proxy_spec("http://") + assert not utils.parse_proxy_spec("foo.com") + assert not utils.parse_proxy_spec("http://") class u_unparse_url(libpry.AutoTree): diff --git a/test/tutils.py b/test/tutils.py index 87977b1cc..c22eb1a06 100644 --- a/test/tutils.py +++ b/test/tutils.py @@ -1,6 +1,6 @@ -import os.path, threading, Queue +import threading, Queue import libpry -from libmproxy import proxy, filt, flow, controller +from libmproxy import proxy, flow, controller import serv, sslserv import random @@ -50,8 +50,8 @@ HTTPS_PORT = random.randint(30000, 40000) class TestMaster(controller.Master): def __init__(self, port, testq): - serv = proxy.ProxyServer(proxy.ProxyConfig("data/testkey.pem"), port) - controller.Master.__init__(self, serv) + s = proxy.ProxyServer(proxy.ProxyConfig("data/testkey.pem"), port) + controller.Master.__init__(self, s) self.testq = testq self.log = []