diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2011-02-24 15:44:08 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2011-02-24 15:44:08 +1300 |
commit | 57f96c5fe014420a09ed42e96f67562fabe33048 (patch) | |
tree | 1e57fd2659ac6243dc0558bfe17f251a0bcf998a | |
parent | 79039eb5d23b6f7076664a3383988cd6b51e377e (diff) | |
download | mitmproxy-57f96c5fe014420a09ed42e96f67562fabe33048.tar.gz mitmproxy-57f96c5fe014420a09ed42e96f67562fabe33048.tar.bz2 mitmproxy-57f96c5fe014420a09ed42e96f67562fabe33048.zip |
Minor housekeeping - unused code, nocover directives.
95% test coverage.
-rw-r--r-- | libmproxy/flow.py | 4 | ||||
-rw-r--r-- | libmproxy/utils.py | 10 | ||||
-rwxr-xr-x | mitmproxy | 13 | ||||
-rw-r--r-- | test/test_utils.py | 3 |
4 files changed, 3 insertions, 27 deletions
diff --git a/libmproxy/flow.py b/libmproxy/flow.py index 9b083036..8e4db57d 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -390,7 +390,9 @@ class FlowMaster(controller.Master): self.stickycookie_state = False def _runscript(self, f, script): - return f.run_script(script) + #begin nocover + raise NotImplementedError + #end nocover def set_response_script(self, s): self.scripts["response"] = s diff --git a/libmproxy/utils.py b/libmproxy/utils.py index c67b9397..d4b72cb6 100644 --- a/libmproxy/utils.py +++ b/libmproxy/utils.py @@ -434,13 +434,3 @@ def dummy_cert(certdir, ca, commonname): ) if ret: return None return certpath - - -def mkdir_p(path): - try: - os.makedirs(path) - except OSError as exc: - if exc.errno == errno.EEXIST: - pass - else: - raise @@ -72,11 +72,6 @@ if __name__ == '__main__': "Options controlling recorder behavior" ) group.add_option( - "-w", "--store", action="store", - type = "str", dest="cache", default=None, - help = "Session store location" - ) - group.add_option( "-C", "--cookies", action="append", type = "str", dest="cookies", default=[], help = "Persistent client cookies already set or generated in client" @@ -86,14 +81,6 @@ if __name__ == '__main__': options, args = parser.parse_args() - if options.cache is not None: - options.cache = os.path.expanduser(options.cache) - if options.cache is not None: - utils.mkdir_p(options.cache) - if os.path.exists(options.cache + "/index.txt"): - print >> sys.stderr, "ERROR: data already recorded in %s"%options.cache - sys.exit(1) - config = proxy.process_certificate_option_group(parser, options) server = proxy.ProxyServer(config, options.port, options.addr) m = console.ConsoleMaster(server, options) diff --git a/test/test_utils.py b/test/test_utils.py index f65c1ea7..be6db4d3 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -310,10 +310,7 @@ class udummy_cert(libpry.AutoTree): assert os.path.exists(os.path.join(d, "foo.com.pem")) - - - tests = [ uformat_timestamp(), uisBin(), |