def test_parse_from_twitch(self): self.assertEqual( IrcMessagePrefix.parse('''\ [email protected]'''), ParsedPrefix(None, 'botgotsthis', 'botgotsthis', 'botgotsthis.tmi.twitch.tv'))
def test_parse_nick_user_host(self): self.assertEqual(IrcMessagePrefix.parse('Kappa!Keepo@localhost'), ParsedPrefix(None, 'Kappa', 'Keepo', 'localhost'))
def test_parse_nick_user_host_2(self): self.assertEqual( IrcMessagePrefix.parse('[email protected]'), ParsedPrefix(None, 'MeGotsThis', 'BotGotsThis', 'megotsthis.com'))
def test_parse_nick_user(self): self.assertEqual(IrcMessagePrefix.parse('Kappa!Keepo'), ParsedPrefix(None, 'Kappa', 'Keepo', None))
def test_parse_nick_number_alpha(self): self.assertEqual(IrcMessagePrefix.parse('123abc'), ParsedPrefix(None, '123abc', None, None))
def test_parse_nick(self): self.assertEqual(IrcMessagePrefix.parse('Kappa'), ParsedPrefix(None, 'Kappa', None, None))
def test_parse_servername_ip_addr(self): self.assertEqual(IrcMessagePrefix.parse('127.0.0.1'), ParsedPrefix('127.0.0.1', None, None, None))
def test_parse_servername(self): self.assertEqual(IrcMessagePrefix.parse('megotsthis.com'), ParsedPrefix('megotsthis.com', None, None, None))