46
46
self.assertEqualDiff('The prefix foo is in the help search path twice.',
49
def test_incompatibleAPI(self):
50
error = errors.IncompatibleAPI("module", (1, 2, 3), (4, 5, 6), (7, 8, 9))
52
'The API for "module" is not compatible with "(1, 2, 3)". '
53
'It supports versions "(4, 5, 6)" to "(7, 8, 9)".',
49
56
def test_inventory_modified(self):
50
57
error = errors.InventoryModified("a tree to be repred")
51
58
self.assertEqualDiff("The current inventory for the tree 'a tree to "
266
273
"Could not understand response from smart server: ('not yes',)",
276
def test_unknown_container_format(self):
277
"""Test the formatting of UnknownContainerFormatError."""
278
e = errors.UnknownContainerFormatError('bad format string')
280
"Unrecognised container format: 'bad format string'",
283
def test_unexpected_end_of_container(self):
284
"""Test the formatting of UnexpectedEndOfContainerError."""
285
e = errors.UnexpectedEndOfContainerError()
287
"Unexpected end of container stream", str(e))
289
def test_unknown_record_type(self):
290
"""Test the formatting of UnknownRecordTypeError."""
291
e = errors.UnknownRecordTypeError("X")
293
"Unknown record type: 'X'",
296
def test_invalid_record(self):
297
"""Test the formatting of InvalidRecordError."""
298
e = errors.InvalidRecordError("xxx")
300
"Invalid record: xxx",
303
def test_container_has_excess_data(self):
304
"""Test the formatting of ContainerHasExcessDataError."""
305
e = errors.ContainerHasExcessDataError("excess bytes")
307
"Container has data after end marker: 'excess bytes'",
310
def test_duplicate_record_name_error(self):
311
"""Test the formatting of DuplicateRecordNameError."""
312
e = errors.DuplicateRecordNameError(u"n\xe5me".encode('utf-8'))
314
"Container has multiple records with the same name: \"n\xc3\xa5me\"",
270
318
class PassThroughError(errors.BzrError):