robotframework-2.7.7.utest.output.test_loggerhelper.py Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of robotframework Show documentation
Show all versions of robotframework Show documentation
High level test automation framework
The newest version!
import unittest
from robot.utils.asserts import assert_raises, assert_equals
from robot.errors import DataError
from robot.output.loggerhelper import AbstractLogger, Message
class TestAbstractLogger(unittest.TestCase):
def test_set_invalid_threshold(self):
logger = AbstractLogger('trace')
assert_raises(DataError, logger.set_level, 'INVALID THRESHOLD')
class TestMessage(unittest.TestCase):
def test_string_message(self):
assert_equals(Message('my message').message, 'my message')
def test_callable_message(self):
assert_equals(Message(lambda: 'my message').message, 'my message')
if __name__ == '__main__':
unittest.main()