Unit test import cleanups.

This commit is contained in:
Aldo Cortesi 2012-02-20 11:04:07 +13:00
parent fa11b7c9be
commit b0f77dfefd
9 changed files with 14 additions and 19 deletions

View File

@ -1,5 +1,3 @@
import socket
from SocketServer import BaseServer
from BaseHTTPServer import HTTPServer
import handler

View File

@ -1,4 +1,4 @@
from libmproxy import console, filt, flow
from libmproxy import console
from libmproxy.console import common
import tutils
import libpry

View File

@ -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):

View File

@ -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")

View File

@ -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()

View File

@ -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):

View File

@ -1,5 +1,4 @@
import urllib, urllib2
from libmproxy import flow
import tutils
class uSanity(tutils.ProxTest):

View File

@ -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):

View File

@ -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 = []