Пример #1
0
    def testExceptionUnicode0(self):
        """
        create an exception with non-ascii chars in message and test WMException.addInfo().
        """

        exception = WMException(
            "an exception message with nr. 100 and some non-ascii characters: ₩♏ℭ☺яε",
            100)
        exception.addInfo(**self.test_data)
        self.logger.debug("XML version of exception: %s", exception.xml())
        self.logger.debug("String version of exception: %s", str(exception))
Пример #2
0
    def testException(self):
        """
        create an exception and do some tests.
        """

        exception = WMException("an exception message with nr. 100", 100)
        self.logger.debug("String version of exception: " + str(exception))
        self.logger.debug("XML version of exception: " + exception.xml())
        self.logger.debug("Adding data")
        data = {}
        data['key1'] = 'value1'
        data['key2'] = 'data2'
        exception.addInfo(**data)
        self.logger.debug("String version of exception: "+ str(exception))
Пример #3
0
    def testExceptionUnicode1(self):
        """
        create an exception with non-ascii chars in message and test WMException constructor
        """

        exception = WMException(
            "an exception message with nr. 100 and some non-ascii characters: ₩♏ℭ☺яε",
            100, **self.test_data)
        self.logger.debug("XML version of exception: %s", exception.xml())
        self.logger.debug("String version of exception: %s", str(exception))
        self.logger.debug("exception.__str__(): %s", type(exception.__str__(
        )))  # from py2 interpreter: <class 'future.types.newbytes.newbytes'>
        self.logger.debug("str(exception): %s", type(
            str(exception)))  # <class 'future.types.newstr.newstr'>
Пример #4
0
    def testException(self):
        """
        create an exception and do some tests (only ascii chars)
        """

        exception = WMException("an exception message with nr. 100", 100)
        self.logger.debug("String version of exception: %s", str(exception))
        self.logger.debug("XML version of exception: %s", exception.xml())
        self.logger.debug("Adding data")
        data = {}
        data['key1'] = 'value1'
        data['key2'] = 3.14159
        exception.addInfo(**data)
        self.logger.debug("String version of exception: %s", str(exception))
Пример #5
0
    def testException(self):
        """
        create an exception and do some tests.
        """

        exception = WMException("an exception message with nr. 100", 100)
        self.logger.debug("String version of exception: " + str(exception))
        self.logger.debug("XML version of exception: " + exception.xml())
        self.logger.debug("Adding data")
        data = {}
        data['key1'] = 'value1'
        data['key2'] = 'data2'
        exception.addInfo(**data)
        self.logger.debug("String version of exception: " + str(exception))
Пример #6
0
    def testExceptionUnicode(self):
        """
        create an exception with non-ascii characters and do some tests.
        """

        exception = WMException(
            "an exception message with nr. 100 and some non-ascii characters: ₩♏ℭ☺яε",
            100)
        self.logger.debug("String version of exception: " + str(exception))
        self.logger.debug("XML version of exception: " + exception.xml())
        self.logger.debug("Adding data")
        data = {}
        data['key1'] = 'value1'
        data['key2'] = 'data2'
        exception.addInfo(**data)
        self.logger.debug("String version of exception: " + str(exception))