mitmproxy/test/test_cmdline.py

30 lines
612 B
Python
Raw Normal View History

2011-03-12 02:14:25 +00:00
import optparse
import libpry
from libmproxy import cmdline
class uAll(libpry.AutoTree):
def test_common(self):
parser = optparse.OptionParser()
cmdline.common_options(parser)
opts, args = parser.parse_args(args=[])
assert cmdline.get_common_options(opts)
opts.stickycookie_all = True
v = cmdline.get_common_options(opts)
assert v["stickycookie"] == ".*"
opts.stickycookie_all = False
opts.stickycookie_filt = "foo"
v = cmdline.get_common_options(opts)
assert v["stickycookie"] == "foo"
tests = [
uAll()
]