/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_options.py

  • Committer: Aaron Bentley
  • Date: 2006-08-16 04:57:05 UTC
  • mto: This revision was merged to the branch mainline in revision 1934.
  • Revision ID: aaron.bentley@utoronto.ca-20060816045705-b4e53acd83d8acb7
Strip out all the EnumOption stuff

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
        def parse(options, args):
58
58
            parser = option.get_optparser(dict((o.name, o) for o in options))
59
59
            return parser.parse_args(args)
60
 
        options = [option.EnumOption('Lawn mower', str, 
61
 
                   [('fast', 'mow quickly'), ('careful', 'mow carefully')])]
62
 
        opts, args = parse(options, ['--fast', '--careful'])
63
 
        self.assertEqual('careful', opts.lawn_mower)
64
 
        options = [option.EnumOption('Number', int, [('11', 'one'), 
65
 
                                                     ('22', 'two')])]
66
 
        opts, args = parse(options, ['--22'])
67
 
        self.assertEqual(22, opts.number)
68
 
 
69
60
        options = [option.Option('hello')]
70
61
        opts, args = parse(options, ['--no-hello', '--hello'])
71
62
        self.assertEqual(True, opts.hello)
81
72
                          ['--no-number'])
82
73
 
83
74
    def test_iter_switches(self):
84
 
        opt = option.EnumOption('Lawn mower', str, 
85
 
                                [('fast', 'mow quickly'), 
86
 
                                 ('careful', 'mow carefully')])
87
 
        self.assertEqual(list(opt.iter_switches()), 
88
 
                         [('fast', None, None, 'mow quickly'), 
89
 
                          ('careful', None, None, 'mow carefully')])
90
75
        opt = option.Option('hello', help='fg')
91
76
        self.assertEqual(list(opt.iter_switches()),
92
77
                         [('hello', None, None, 'fg')])