/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 breezy/tests/test_options.py

  • Committer: Jelmer Vernooij
  • Date: 2019-03-05 07:32:38 UTC
  • mto: (7290.1.21 work)
  • mto: This revision was merged to the branch mainline in revision 7311.
  • Revision ID: jelmer@jelmer.uk-20190305073238-zlqn981opwnqsmzi
Add appveyor configuration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
        options = [option.Option('number', type=int)]
111
111
        opts, args = self.parse(options, ['--number', '6'])
112
112
        self.assertEqual(6, opts.number)
113
 
        self.assertRaises(errors.CommandError, self.parse, options,
 
113
        self.assertRaises(errors.BzrCommandError, self.parse, options,
114
114
                          ['--number'])
115
 
        self.assertRaises(errors.CommandError, self.parse, options,
 
115
        self.assertRaises(errors.BzrCommandError, self.parse, options,
116
116
                          ['--no-number'])
117
 
        self.assertRaises(errors.CommandError, self.parse, options,
118
 
                          ['--number', 'a'])
119
117
 
120
118
    def test_is_hidden(self):
121
119
        self.assertTrue(option.Option('foo', hidden=True).is_hidden('foo'))
136
134
        self.assertEqual({'format': 'two'}, opts)
137
135
        self.assertRaises(option.BadOptionValue, self.parse, options,
138
136
                          ['--format', 'three'])
139
 
        self.assertRaises(errors.CommandError, self.parse, options,
 
137
        self.assertRaises(errors.BzrCommandError, self.parse, options,
140
138
                          ['--two'])
141
139
        options = [option.RegistryOption('format', '', registry, str,
142
140
                                         value_switches=True)]
149
147
        self.assertEqual({'format': 'two'}, opts)
150
148
        options = [option.RegistryOption('format', '', registry, str,
151
149
                                         enum_switch=False)]
152
 
        self.assertRaises(errors.CommandError, self.parse, options,
 
150
        self.assertRaises(errors.BzrCommandError, self.parse, options,
153
151
                          ['--format', 'two'])
154
152
 
155
153
    def test_override(self):
373
371
                    msgs.append('%-16s %-16s %s' %
374
372
                                ((scope or 'GLOBAL'), name, 'NO HELP'))
375
373
                elif not option_re.match(helptxt):
 
374
                    if name.startswith("format/"):
 
375
                        # Don't complain about the odd format registry help
 
376
                        continue
376
377
                    msgs.append('%-16s %-16s %s' %
377
378
                                ((scope or 'GLOBAL'), name, helptxt))
378
379
        if msgs: