/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: 2020-06-23 01:02:30 UTC
  • mfrom: (7490.40.27 work)
  • mto: This revision was merged to the branch mainline in revision 7517.
  • Revision ID: jelmer@jelmer.uk-20200623010230-62nnywznmb76h6ut
Merge lp:brz/3.1.

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.BzrCommandError, self.parse, options,
 
113
        self.assertRaises(errors.CommandError, self.parse, options,
114
114
                          ['--number'])
115
 
        self.assertRaises(errors.BzrCommandError, self.parse, options,
 
115
        self.assertRaises(errors.CommandError, self.parse, options,
116
116
                          ['--no-number'])
117
 
        self.assertRaises(errors.BzrCommandError, self.parse, options,
 
117
        self.assertRaises(errors.CommandError, self.parse, options,
118
118
                          ['--number', 'a'])
119
119
 
120
120
    def test_is_hidden(self):
136
136
        self.assertEqual({'format': 'two'}, opts)
137
137
        self.assertRaises(option.BadOptionValue, self.parse, options,
138
138
                          ['--format', 'three'])
139
 
        self.assertRaises(errors.BzrCommandError, self.parse, options,
 
139
        self.assertRaises(errors.CommandError, self.parse, options,
140
140
                          ['--two'])
141
141
        options = [option.RegistryOption('format', '', registry, str,
142
142
                                         value_switches=True)]
149
149
        self.assertEqual({'format': 'two'}, opts)
150
150
        options = [option.RegistryOption('format', '', registry, str,
151
151
                                         enum_switch=False)]
152
 
        self.assertRaises(errors.BzrCommandError, self.parse, options,
 
152
        self.assertRaises(errors.CommandError, self.parse, options,
153
153
                          ['--format', 'two'])
154
154
 
155
155
    def test_override(self):
373
373
                    msgs.append('%-16s %-16s %s' %
374
374
                                ((scope or 'GLOBAL'), name, 'NO HELP'))
375
375
                elif not option_re.match(helptxt):
376
 
                    if name.startswith("format/"):
377
 
                        # Don't complain about the odd format registry help
378
 
                        continue
379
376
                    msgs.append('%-16s %-16s %s' %
380
377
                                ((scope or 'GLOBAL'), name, helptxt))
381
378
        if msgs: