MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / MockParser

Class MockParser

test/mitmproxy/test_proxy.py:10–17  ·  view source on GitHub ↗

argparse.ArgumentParser sys.exits() by default. Make it more testable by throwing an exception instead.

Source from the content-addressed store, hash-verified

8
9
10class MockParser(argparse.ArgumentParser):
11 """
12 argparse.ArgumentParser sys.exits() by default.
13 Make it more testable by throwing an exception instead.
14 """
15
16 def error(self, message):
17 raise Exception(message)
18
19
20class TestProcessProxyOptions:

Callers 1

pMethod · 0.85

Calls

no outgoing calls

Tested by 1

pMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…