aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-06-24 15:12:31 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-06-24 15:12:31 +1200
commit877b5a2d116c1ee0a8eb26191a65ff87f7146ae0 (patch)
tree8df91510161f867960f1e043adf2da23e239ee1b /libpathod
parent2e558b7e9d435216ff8c4c76df130fbf3936f803 (diff)
downloadmitmproxy-877b5a2d116c1ee0a8eb26191a65ff87f7146ae0.tar.gz
mitmproxy-877b5a2d116c1ee0a8eb26191a65ff87f7146ae0.tar.bz2
mitmproxy-877b5a2d116c1ee0a8eb26191a65ff87f7146ae0.zip
Add staticdir to test.Test.
Diffstat (limited to 'libpathod')
-rw-r--r--libpathod/test.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/libpathod/test.py b/libpathod/test.py
index 943fe3c0..cb1b9745 100644
--- a/libpathod/test.py
+++ b/libpathod/test.py
@@ -8,7 +8,7 @@ IFACE = "127.0.0.1"
class Daemon:
def __init__(self, staticdir=None, anchors=(), ssl=None):
self.q = Queue.Queue()
- self.thread = PaThread(self.q, ssl)
+ self.thread = PaThread(self.q, ssl, staticdir)
self.thread.start()
self.port = self.q.get(True, 5)
self.urlbase = "%s://%s:%s"%("https" if ssl else "http", IFACE, self.port)
@@ -43,9 +43,9 @@ class Daemon:
class PaThread(threading.Thread):
- def __init__(self, q, ssl):
+ def __init__(self, q, ssl, staticdir):
threading.Thread.__init__(self)
- self.q, self.ssl = q, ssl
+ self.q, self.ssl, self.staticdir = q, ssl, staticdir
self.port = None
def run(self):
@@ -56,7 +56,10 @@ class PaThread(threading.Thread):
)
else:
ssloptions = self.ssl
- self.server = pathod.Pathod((IFACE, 0), ssloptions=ssloptions)
- #self.server, self.port = pathod.make_server(self.app, 0, IFACE, ssloptions)
+ self.server = pathod.Pathod(
+ (IFACE, 0),
+ ssloptions = ssloptions,
+ staticdir = self.staticdir
+ )
self.q.put(self.server.port)
self.server.serve_forever()