/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

Merge with __contains__

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
            "Error: the reason why",
46
46
            str(error))
47
47
 
 
48
    def test_dirstate_corrupt(self):
 
49
        error = errors.DirstateCorrupt('.bzr/checkout/dirstate',
 
50
                                       'trailing garbage: "x"')
 
51
        self.assertEqualDiff("The dirstate file (.bzr/checkout/dirstate)"
 
52
            " appears to be corrupt: trailing garbage: \"x\"",
 
53
            str(error))
 
54
 
48
55
    def test_disabled_method(self):
49
56
        error = errors.DisabledMethod("class name")
50
57
        self.assertEqualDiff(
384
391
            host='ahost', port=444, msg='Unable to connect to ssh host',
385
392
            orig_error='my_error')
386
393
 
 
394
    def test_target_not_branch(self):
 
395
        """Test the formatting of TargetNotBranch."""
 
396
        error = errors.TargetNotBranch('foo')
 
397
        self.assertEqual(
 
398
            "Your branch does not have all of the revisions required in "
 
399
            "order to merge this merge directive and the target "
 
400
            "location specified in the merge directive is not a branch: "
 
401
            "foo.", str(error))
 
402
 
387
403
    def test_malformed_bug_identifier(self):
388
404
        """Test the formatting of MalformedBugIdentifier."""
389
405
        error = errors.MalformedBugIdentifier('bogus', 'reason for bogosity')
532
548
            'Tip change rejected: Unicode message\xe2\x80\xbd',
533
549
            str(err))
534
550
 
 
551
    def test_error_from_smart_server(self):
 
552
        error_tuple = ('error', 'tuple')
 
553
        err = errors.ErrorFromSmartServer(error_tuple)
 
554
        self.assertEquals(
 
555
            "Error received from smart server: ('error', 'tuple')", str(err))
 
556
 
 
557
    def test_untranslateable_error_from_smart_server(self):
 
558
        error_tuple = ('error', 'tuple')
 
559
        orig_err = errors.ErrorFromSmartServer(error_tuple)
 
560
        err = errors.UnknownErrorFromSmartServer(orig_err)
 
561
        self.assertEquals(
 
562
            "Server sent an unexpected error: ('error', 'tuple')", str(err))
 
563
 
535
564
 
536
565
class PassThroughError(errors.BzrError):
537
566