def testshouldFailColorizeWithBackground(self): trace = "FATAL there could be an error in the application" level = 'WARN' sys.stdout = Writer() logcolors = LogColors() termcolors = TermColorCodes() logcolors.parse_config(PropertiesBackGround()) message = Message(logcolors) notifier = notifications.Print() anylog = Log('out.log') message.parse(trace, anylog) output = logcolors.getLevelColor(level)+trace+termcolors.reset notifier.notify(message,anylog) self.assertNotEqual(output, sys.stdout.captured[0])
def testLogColorsParseConfig(self): logcolors = LogColors() logcolors.parse_config(PropertiesMock()) self.assertFalse(hasattr(logcolors,'one')) self.assertFalse(hasattr(logcolors,'two'))