diff options
author | Aldo Cortesi <aldo@corte.si> | 2017-05-02 12:17:57 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-02 12:17:57 +1200 |
commit | 8d29492960a89078ad2743e648afa08a3c71ebc1 (patch) | |
tree | e7e9474787505ffbaa348fbd0235529adb74f0e7 /pathod/test.py | |
parent | 53ad658e9f59743b72cb234f9b160aa6dc3d1f72 (diff) | |
parent | e24b4cc1b64455b8b9b5d1265103054bb8b3a8af (diff) | |
download | mitmproxy-8d29492960a89078ad2743e648afa08a3c71ebc1.tar.gz mitmproxy-8d29492960a89078ad2743e648afa08a3c71ebc1.tar.bz2 mitmproxy-8d29492960a89078ad2743e648afa08a3c71ebc1.zip |
Merge pull request #2299 from iharsh234/mypy-pathod
Mypy Checking to pathod
Diffstat (limited to 'pathod/test.py')
-rw-r--r-- | pathod/test.py | 14 |
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. """ |