Beispiel #1
0
    def test_error_exception(self):
        """ Tpl.error() exception test """

        undefined = 'undefined'
        with self.assertRaises(TplError) as context:
            Tpl.error(key=undefined)
        self.assertTrue(undefined in str(context.exception))
        self.assertTrue(TplError == context.expected)
Beispiel #2
0
    def test_error_exception(self):
        """ Tpl.error() exception test """

        undefined = 'undefined'
        with self.assertRaises(TplError) as context:
            Tpl.error(key=undefined)
        self.assertTrue(undefined in str(context.exception))
        self.assertTrue(TplError == context.expected)
Beispiel #3
0
    def terminate(cls, msg):
        """
        Terminate thread
        :param str msg: output message
        :return: None
        """

        tpl.error(msg)
        process.kill()
Beispiel #4
0
    def terminate(cls, msg):
        """
        Terminate thread
        :param str msg: output message
        :return: None
        """

        tpl.error(msg)
        process.kill()
Beispiel #5
0
    def test_error(self):
        """ Tpl.error() test """

        with patch('sys.stderr', new=StringIO()) as fakeOutput:
            Tpl.error('test_error')
            self.assertTrue('' in fakeOutput.getvalue().strip())
Beispiel #6
0
    def test_error(self):
        """ Tpl.error() test """

        with patch('sys.stderr', new=StringIO()) as fakeOutput:
            Tpl.error('test_error')
            self.assertTrue('' in fakeOutput.getvalue().strip())