Exemple #1
0
    def test_allow_permanent_addition_of_more_tags(self):
        log = ratlog.Log("test1")

        log.tags.append("test2")

        log("message")

        assert "[test1|test2] message\n" == output.value
Exemple #2
0
    def test_generic_spec_cases(self, expected, data):
        log = ratlog.Log(*data.get("tags", []))

        log(data.get("message", ""), data.get("fields"))

        assert expected == output.value
Exemple #3
0
    def test_allow_more_tags_on_exisiting_instance(self):
        log = ratlog.Log("test1", "test2")

        log("message", {}, "test3")

        assert "[test1|test2|test3] message\n" == output.value
Exemple #4
0
    def test_multiple_tags_on_instance_create(self):
        log = ratlog.Log("test1", "test2", "test3")

        log("message")

        assert "[test1|test2|test3] message\n" == output.value
Exemple #5
0
    def test_string_as_fields_makes_tags(self):
        log = ratlog.Log()

        log("message", "tag1", "tag2")

        assert "[tag1|tag2] message\n" == output.value
Exemple #6
0
    def test_unicode_as_message(self):
        log = ratlog.Log()

        log(u"\U0001F984")

        assert u"🦄\n" == output.value
Exemple #7
0
    def test_integer_as_message(self):
        log = ratlog.Log()

        log(1)

        assert "1\n" == output.value
Exemple #8
0
    def test_creating_logger(self):
        log = ratlog.Log()

        assert isinstance(log, ratlog.Log)