aboutsummaryrefslogtreecommitdiffstats
path: root/pathod/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'pathod/test.py')
-rw-r--r--pathod/test.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/pathod/test.py b/pathod/test.py
index 81f5805f..52f3ba02 100644
--- a/pathod/test.py
+++ b/pathod/test.py
@@ -1,16 +1,16 @@
import io
import time
import queue
-
from . import pathod
from mitmproxy.types import basethread
+import typing # noqa
class Daemon:
IFACE = "127.0.0.1"
- def __init__(self, ssl=None, **daemonargs):
- self.q = queue.Queue()
+ def __init__(self, ssl=None, **daemonargs) -> None:
+ self.q = queue.Queue() # type: queue.Queue
self.logfp = io.StringIO()
daemonargs["logfp"] = self.logfp
self.thread = _PaThread(self.IFACE, self.q, ssl, daemonargs)
@@ -25,18 +25,18 @@ class Daemon:
def __enter__(self):
return self
- def __exit__(self, type, value, traceback):
+ def __exit__(self, type, value, traceback) -> bool:
self.logfp.truncate(0)
self.shutdown()
return False
- def p(self, spec):
+ def p(self, spec: str) -> str:
"""
Return a URL that will render the response in spec.
"""
return "%s/p/%s" % (self.urlbase, spec)
- def text_log(self):
+ def text_log(self) -> str:
return self.logfp.getvalue()
def wait_for_silence(self, timeout=5):
@@ -62,7 +62,7 @@ class Daemon:
return None
return l[-1]
- def log(self):
+ def log(self) -> typing.List[typing.Dict]:
"""
Return the log buffer as a list of dictionaries.
"""