/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

  • Committer: Martin Pool
  • Date: 2007-09-14 06:31:28 UTC
  • mfrom: (2822 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2823.
  • Revision ID: mbp@sourcefrog.net-20070914063128-0p7mh6zfb4pzdg9p
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
            'It supports versions "(4, 5, 6)" to "(7, 8, 9)".',
54
54
            str(error))
55
55
 
 
56
    def test_in_process_transport(self):
 
57
        error = errors.InProcessTransport('fpp')
 
58
        self.assertEqualDiff(
 
59
            "The transport 'fpp' is only accessible within this process.",
 
60
            str(error))
 
61
 
56
62
    def test_inventory_modified(self):
57
63
        error = errors.InventoryModified("a tree to be repred")
58
64
        self.assertEqualDiff("The current inventory for the tree 'a tree to "
75
81
            "cannot be broken.",
76
82
            str(error))
77
83
 
 
84
    def test_knit_data_stream_incompatible(self):
 
85
        error = errors.KnitDataStreamIncompatible(
 
86
            'stream format', 'target format')
 
87
        self.assertEqual('Cannot insert knit data stream of format '
 
88
                         '"stream format" into knit of format '
 
89
                         '"target format".', str(error))
 
90
 
78
91
    def test_knit_header_error(self):
79
92
        error = errors.KnitHeaderError('line foo\n', 'path/to/file')
80
93
        self.assertEqual("Knit header error: 'line foo\\n' unexpected"
81
 
                         " for file path/to/file", str(error))
 
94
                         " for file \"path/to/file\".", str(error))
82
95
 
83
96
    def test_knit_index_unknown_method(self):
84
97
        error = errors.KnitIndexUnknownMethod('http://host/foo.kndx',
112
125
 
113
126
    def test_no_such_id(self):
114
127
        error = errors.NoSuchId("atree", "anid")
115
 
        self.assertEqualDiff("The file id anid is not present in the tree "
 
128
        self.assertEqualDiff("The file id \"anid\" is not present in the tree "
116
129
            "atree.",
117
130
            str(error))
118
131
 
119
132
    def test_no_such_revision_in_tree(self):
120
133
        error = errors.NoSuchRevisionInTree("atree", "anid")
121
 
        self.assertEqualDiff("The revision id anid is not present in the tree "
122
 
            "atree.",
123
 
            str(error))
 
134
        self.assertEqualDiff("The revision id {anid} is not present in the"
 
135
                             " tree atree.", str(error))
124
136
        self.assertIsInstance(error, errors.NoSuchRevision)
125
137
 
126
138
    def test_not_write_locked(self):
347
359
        """Test the formatting of DuplicateRecordNameError."""
348
360
        e = errors.DuplicateRecordNameError(u"n\xe5me".encode('utf-8'))
349
361
        self.assertEqual(
350
 
            "Container has multiple records with the same name: \"n\xc3\xa5me\"",
 
362
            "Container has multiple records with the same name: n\xc3\xa5me",
351
363
            str(e))
352
364
 
353
365