~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_errors.py

Start implementing container format reading and writing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
266
266
            "Could not understand response from smart server: ('not yes',)",
267
267
            str(e))
268
268
 
 
269
    def test_unknown_container_format(self):
 
270
        """Test the formatting of UnknownContainerFormatError."""
 
271
        e = errors.UnknownContainerFormatError('bad format string')
 
272
        self.assertEqual(
 
273
            "Unrecognised container format: 'bad format string'",
 
274
            str(e))
 
275
 
 
276
    def test_unexpected_end_of_container(self):
 
277
        """Test the formatting of UnexpectedEndOfContainerError."""
 
278
        e = errors.UnexpectedEndOfContainerError()
 
279
        self.assertEqual(
 
280
            "Unexpected end of container stream", str(e))
 
281
 
 
282
    def test_unknown_record_type(self):
 
283
        """Test the formatting of UnknownRecordTypeError."""
 
284
        e = errors.UnknownRecordTypeError("X")
 
285
        self.assertEqual(
 
286
            "Unknown record type: 'X'",
 
287
            str(e))
 
288
 
269
289
 
270
290
class PassThroughError(errors.BzrError):
271
291