/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_errors.py

remove all trailing whitespace from bzr source

Show diffs side-by-side

added added

removed removed

Lines of Context:
158
158
        error = errors.MediumNotConnected("a medium")
159
159
        self.assertEqualDiff(
160
160
            "The medium 'a medium' is not connected.", str(error))
161
 
 
 
161
 
162
162
    def test_no_public_branch(self):
163
163
        b = self.make_branch('.')
164
164
        error = errors.NoPublicBranch(b)
171
171
        error = errors.NoRepositoryPresent(dir)
172
172
        self.assertNotEqual(-1, str(error).find((dir.transport.clone('..').base)))
173
173
        self.assertEqual(-1, str(error).find((dir.transport.base)))
174
 
        
 
174
 
175
175
    def test_no_smart_medium(self):
176
176
        error = errors.NoSmartMedium("a transport")
177
177
        self.assertEqualDiff("The transport 'a transport' cannot tunnel the "
461
461
        self.assertEqual(
462
462
            "Container has multiple records with the same name: n\xc3\xa5me",
463
463
            str(e))
464
 
        
 
464
 
465
465
    def test_check_error(self):
466
466
        # This has a member called 'message', which is problematic in
467
467
        # python2.5 because that is a slot on the base Exception class
560
560
        err = errors.UnknownErrorFromSmartServer(orig_err)
561
561
        self.assertEquals(
562
562
            "Server sent an unexpected error: ('error', 'tuple')", str(err))
563
 
    
 
563
 
564
564
    def test_smart_message_handler_error(self):
565
565
        # Make an exc_info tuple.
566
566
        try:
574
574
 
575
575
 
576
576
class PassThroughError(errors.BzrError):
577
 
    
 
577
 
578
578
    _fmt = """Pass through %(foo)s and %(bar)s"""
579
579
 
580
580
    def __init__(self, foo, bar):
591
591
 
592
592
 
593
593
class TestErrorFormatting(TestCase):
594
 
    
 
594
 
595
595
    def test_always_str(self):
596
596
        e = PassThroughError(u'\xb5', 'bar')
597
597
        self.assertIsInstance(e.__str__(), str)
608
608
                ['ErrorWithNoFormat uses its docstring as a format, it should use _fmt instead'],
609
609
                lambda x: str(x), e)
610
610
        ## s = str(e)
611
 
        self.assertEqual(s, 
 
611
        self.assertEqual(s,
612
612
                "This class has a docstring but no format string.")
613
613
 
614
614
    def test_mismatched_format_args(self):