aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2012-07-16 16:54:09 -0700
committerAldo Cortesi <aldo@corte.si>2012-07-16 16:54:09 -0700
commit2be31b726ac38132c7a3f89cc3d47afe666c5f53 (patch)
tree8f14ecc06ebae9995e74f82f01e2ef3007c412d8
parente4079aa746e861c5d39f2812520e33c4d17d1007 (diff)
parent1a26f8215de76cb21e4c9100b4a8f766f872ac38 (diff)
downloadmitmproxy-2be31b726ac38132c7a3f89cc3d47afe666c5f53.tar.gz
mitmproxy-2be31b726ac38132c7a3f89cc3d47afe666c5f53.tar.bz2
mitmproxy-2be31b726ac38132c7a3f89cc3d47afe666c5f53.zip
Merge pull request #51 from dnet/master
Test cleanup and missing dependencies
-rw-r--r--README.mkd4
-rw-r--r--test/test_console_help.py2
-rw-r--r--test/test_flow.py4
-rw-r--r--test/test_proxy.py5
-rw-r--r--test/test_script.py1
-rw-r--r--test/test_server.py7
-rw-r--r--test/test_utils.py3
-rw-r--r--test/tutils.py5
8 files changed, 10 insertions, 21 deletions
diff --git a/README.mkd b/README.mkd
index c78e1bb6..c6345dd6 100644
--- a/README.mkd
+++ b/README.mkd
@@ -54,12 +54,14 @@ Requirements
* [urwid](http://excess.org/urwid/) version 0.9.8 or newer.
* [PIL](http://www.pythonware.com/products/pil/) version 1.1 or newer.
* [lxml](http://lxml.de/) version 2.3 or newer.
+* [netlib](http://pypi.python.org/pypi/netlib) 0.1 or newer.
The following auxiliary components may be needed if you plan to hack on
mitmproxy:
* The test suite uses the [nose](http://readthedocs.org/docs/nose/en/latest/) unit testing
- framework.
+ framework and requires [human_curl](https://github.com/Lispython/human_curl) and
+ [pathod](http://pypi.python.org/pypi/pathod).
* Rendering the documentation requires [countershape](http://github.com/cortesi/countershape).
__mitmproxy__ is tested and developed on OSX, Linux and OpenBSD. Windows is not
diff --git a/test/test_console_help.py b/test/test_console_help.py
index c9ef7228..98e202ad 100644
--- a/test/test_console_help.py
+++ b/test/test_console_help.py
@@ -1,6 +1,4 @@
-import sys
import libmproxy.console.help as help
-from libmproxy import utils, flow, encoding
class DummyMaster:
def make_view(self):
diff --git a/test/test_flow.py b/test/test_flow.py
index 99df9ed0..a2051eae 100644
--- a/test/test_flow.py
+++ b/test/test_flow.py
@@ -2,9 +2,7 @@ import Queue, time, os.path
from cStringIO import StringIO
import email.utils
from libmproxy import filt, flow, controller, utils, tnetstring
-from netlib import certutils
import tutils
-import libpry
class TestStickyCookieState:
@@ -145,7 +143,7 @@ class TestServerPlaybackState:
s = flow.ServerPlaybackState(None, [r, r2], False, True)
assert s.count() == 2
- n = s.next_flow(r)
+ s.next_flow(r)
assert s.count() == 2
diff --git a/test/test_proxy.py b/test/test_proxy.py
index 10587168..e137c687 100644
--- a/test/test_proxy.py
+++ b/test/test_proxy.py
@@ -1,7 +1,4 @@
-import cStringIO, textwrap
-from cStringIO import StringIO
-import libpry
-from libmproxy import proxy, flow
+from libmproxy import proxy
import tutils
diff --git a/test/test_script.py b/test/test_script.py
index 88f32ddf..407c9b4b 100644
--- a/test/test_script.py
+++ b/test/test_script.py
@@ -1,4 +1,3 @@
-import os
from libmproxy import script, flow
import tutils
diff --git a/test/test_server.py b/test/test_server.py
index 86dc0a4a..38d33d90 100644
--- a/test/test_server.py
+++ b/test/test_server.py
@@ -1,7 +1,4 @@
-import urllib, urllib2, unittest
-import time
-import libpathod.test, requests
-from netlib import tcp, http
+from netlib import tcp
import tutils
"""
@@ -36,7 +33,7 @@ class SanityMixin:
# Port error
l.request.port = 1
- rt = self.master.replay_request(l, block=True)
+ self.master.replay_request(l, block=True)
assert l.error
diff --git a/test/test_utils.py b/test/test_utils.py
index e23d919f..49312a4b 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -1,6 +1,5 @@
-import textwrap, re, json
+import json
from libmproxy import utils
-from nose.tools import assert_raises
import tutils
utils.CERT_SLEEP_TIME = 0
diff --git a/test/tutils.py b/test/tutils.py
index a35dc4d4..0e661a4b 100644
--- a/test/tutils.py
+++ b/test/tutils.py
@@ -1,11 +1,10 @@
-import threading, Queue, time
+import threading, Queue
import os, shutil, tempfile
from contextlib import contextmanager
from libmproxy import proxy, flow, controller, utils
from netlib import certutils
import human_curl as hurl
import libpathod.test
-import random
def treq(conn=None):
if not conn:
@@ -51,7 +50,7 @@ class TestMaster(flow.FlowMaster):
self.testq = testq
def handle(self, m):
- f = flow.FlowMaster.handle(self, m)
+ flow.FlowMaster.handle(self, m)
m._ack()