Exemplo n.º 1
0
    def testExceptionThatCannotBePrinted(self):
        """win32all exceptions may contain localized error
        messages. But Exception.__str__ does not handle non-ASCII
        characters in the args instance variable; calling
        unicode(instance) is just like calling str(instance) and
        raises an UnicodeEncodeError."""

        e = Exception(u'é')
        try:
            render.exception(Exception, e)
        except UnicodeEncodeError: # pragma: no cover
            self.fail() 
Exemplo n.º 2
0
 def testRenderUnicodeDecodeError(self):
     try:
         'abc'.encode('utf-16').decode('utf-8')
     except UnicodeDecodeError, instance:
         self.assertEqual(unicode(instance), 
                          render.exception(UnicodeDecodeError, instance))
Exemplo n.º 3
0
 def testRenderException(self):
     instance = Exception()
     self.assertEqual(unicode(instance), 
                      render.exception(Exception, instance))