def testColorizeNoSuchColor(self): """Some nonexistent colors""" greet = "Hello <puce>world" self.assertEqual(colorize(greet), greet) greet = "Hello <cerulean>world" self.assertEqual(colorize(greet), greet)
def testColorizeSyntax(self): """Syntax cases""" # nesting greet = "Hello <<red>>world" self.assertEqual(colorize(greet), "Hello <\x035>world") # multiline greet = "Hello\n<red>world" self.assertEqual(colorize(greet), "Hello\n\x035world") # empty token handled ok greet = "Hello <>world" self.assertEqual(colorize(greet), greet) # extra spaces not allowed greet = "Hello < red >world" self.assertEqual(colorize(greet), greet) # case sensitive greet = "Hello <RED>world" self.assertEqual(colorize(greet), greet)
def sendLine(self, line): line = colorize(line) line = line.encode('utf8') IRCClient.sendLine(self, line)
def testColorize(self): """mIRC colors""" self.assertEqual(colorize("Hello <red>world"), "Hello \x035world") self.assertEqual(colorize("Hello <white>world"), "Hello \x030world") self.assertEqual(colorize("Hello <black>world"), "Hello \x031world")
def sendLine(self, line): line = colorize(line) line = line.encode('utf8') basic.LineReceiver.sendLine(self, line)