/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: Andrew Bennetts
  • Date: 2009-01-06 05:59:04 UTC
  • mto: This revision was merged to the branch mainline in revision 3922.
  • Revision ID: andrew.bennetts@canonical.com-20090106055904-vw02l7ut9d1nbfo5
Add test, tweak traceback formatting.

Show diffs side-by-side

added added

removed removed

Lines of Context:
560
560
        err = errors.UnknownErrorFromSmartServer(orig_err)
561
561
        self.assertEquals(
562
562
            "Server sent an unexpected error: ('error', 'tuple')", str(err))
 
563
    
 
564
    def test_smart_message_handler_error(self):
 
565
        # Make an exc_info tuple.
 
566
        try:
 
567
            raise Exception("example error")
 
568
        except Exception:
 
569
            exc_info = sys.exc_info()
 
570
        err = errors.SmartMessageHandlerError(exc_info)
 
571
        self.assertStartsWith(
 
572
            str(err), "The message handler raised an exception:\n")
 
573
        self.assertEndsWith(str(err), "Exception: example error\n")
563
574
 
564
575
 
565
576
class PassThroughError(errors.BzrError):