All Downloads are FREE. Search and download functionalities are using the official Maven repository.

robotframework-2.7.7.utest.output.test_loggerhelper.py Maven / Gradle / Ivy

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()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy