/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_commands.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:
63
63
    def test_unicode_command(self):
64
64
        # This error is thrown when we can't find the command in the
65
65
        # list of available commands
66
 
        self.assertRaises(errors.BzrCommandError,
 
66
        self.assertRaises(errors.CommandError,
67
67
                          commands.run_bzr, [u'cmd\xb5'])
68
68
 
69
69
    def test_unicode_option(self):
72
72
        import optparse
73
73
        if optparse.__version__ == "1.5.3":
74
74
            raise TestSkipped("optparse 1.5.3 can't handle unicode options")
75
 
        self.assertRaises(errors.BzrCommandError,
 
75
        self.assertRaises(errors.CommandError,
76
76
                          commands.run_bzr, ['log', u'--option\xb5'])
77
77
 
78
78
    @staticmethod
324
324
        commands.install_bzr_command_hooks()
325
325
 
326
326
    def test_not_found_no_suggestion(self):
327
 
        e = self.assertRaises(errors.BzrCommandError,
 
327
        e = self.assertRaises(errors.CommandError,
328
328
                              commands.get_cmd_object, 'idontexistand')
329
329
        self.assertEqual('unknown command "idontexistand"', str(e))
330
330
 
331
331
    def test_not_found_with_suggestion(self):
332
 
        e = self.assertRaises(errors.BzrCommandError,
 
332
        e = self.assertRaises(errors.CommandError,
333
333
                              commands.get_cmd_object, 'statue')
334
334
        self.assertEqual('unknown command "statue". Perhaps you meant "status"',
335
335
                         str(e))
452
452
        self.assertEqual(['run', 'post'], hook_calls)
453
453
 
454
454
    def test_pre_command_error(self):
455
 
        """Ensure an BzrCommandError in pre_command aborts the command"""
 
455
        """Ensure an CommandError in pre_command aborts the command"""
456
456
 
457
457
        hook_calls = []
458
458
 
459
459
        def pre_command(cmd):
460
460
            hook_calls.append('pre')
461
 
            # verify that all subclasses of BzrCommandError caught too
 
461
            # verify that all subclasses of CommandError caught too
462
462
            raise commands.BzrOptionError()
463
463
 
464
464
        def post_command(cmd, e):
475
475
            "post_command", post_command, None)
476
476
 
477
477
        self.assertEqual([], hook_calls)
478
 
        self.assertRaises(errors.BzrCommandError,
 
478
        self.assertRaises(errors.CommandError,
479
479
                          commands.run_bzr, [u'rocks'])
480
480
        self.assertEqual(['pre'], hook_calls)
481
481