aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_cmdline.py
blob: 799e0e24aeeafb632280179a7d010d3ed300a761 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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()
]