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)
def terminate(cls, msg): """ Terminate thread :param str msg: output message :return: None """ tpl.error(msg) process.kill()
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())