| 254 | self.assertEqual(log_event, uncolored_log_event) |
| 255 | |
| 256 | def test_highlight(self): |
| 257 | text = "INFO" |
| 258 | log_event = "This is an INFO log with info occurring a lot of times. Because we are testing INFO." |
| 259 | self.keyword = Keyword(text) |
| 260 | |
| 261 | log_event_after_highlighting = self.keyword.highlight(log_event) |
| 262 | |
| 263 | self.assertEqual( |
| 264 | "This is an " |
| 265 | + colorama.Fore.GREEN |
| 266 | + text |
| 267 | + colorama.Style.RESET_ALL |
| 268 | + " log with " |
| 269 | + colorama.Fore.GREEN |
| 270 | + text.lower() |
| 271 | + colorama.Style.RESET_ALL |
| 272 | + " occurring a lot of times. Because we are testing " |
| 273 | + colorama.Fore.GREEN |
| 274 | + text |
| 275 | + colorama.Style.RESET_ALL |
| 276 | + ".", |
| 277 | log_event_after_highlighting, |
| 278 | ) |
| 279 | |
| 280 | |
| 281 | class InteractivePrinterTest(unittest.TestCase): |