def test_text_highliter(self): self.assertEqual(text_highlighter('online'), '<span style="color:green;">online</span>') self.assertEqual(text_highlighter('offline'), '<span style="color:red;">offline</span>') self.assertEqual(text_highlighter('foo'), 'foo') self.assertEqual(text_highlighter('foo', green=['*']), '<span style="color:green;">foo</span>') self.assertEqual(text_highlighter('foo', red=['*']), '<span style="color:red;">foo</span>')
def test_text_highlighter(input_data, keyword_args, expected_output): assert text_highlighter(input_data, **keyword_args) == expected_output