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
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
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
def test_multiple_tags_on_instance_create(self): log = ratlog.Log("test1", "test2", "test3") log("message") assert "[test1|test2|test3] message\n" == output.value
def test_string_as_fields_makes_tags(self): log = ratlog.Log() log("message", "tag1", "tag2") assert "[tag1|tag2] message\n" == output.value
def test_unicode_as_message(self): log = ratlog.Log() log(u"\U0001F984") assert u"🦄\n" == output.value
def test_integer_as_message(self): log = ratlog.Log() log(1) assert "1\n" == output.value
def test_creating_logger(self): log = ratlog.Log() assert isinstance(log, ratlog.Log)