예제 #1
0
 def test_line(self):
     line = irctokens.tokenise(":nick!user@host PRIVMSG #channel hello")
     hostmask = irctokens.Hostmask("nick!user@host")
     self.assertEqual(line.hostmask, hostmask)
     self.assertEqual(line.hostmask.nickname, "nick")
     self.assertEqual(line.hostmask.username, "user")
     self.assertEqual(line.hostmask.hostname, "host")
예제 #2
0
 def test_all(self):
     hostmask = irctokens.Hostmask("nick!user@host")
     self.assertEqual(hostmask.nickname, "nick")
     self.assertEqual(hostmask.username, "user")
     self.assertEqual(hostmask.hostname, "host")
예제 #3
0
 def test_no_ident(self):
     hostmask = irctokens.Hostmask("nick@host")
     self.assertEqual(hostmask.nickname, "nick")
     self.assertIsNone(hostmask.username)
     self.assertEqual(hostmask.hostname, "host")
예제 #4
0
 def test_only_nickname(self):
     hostmask = irctokens.Hostmask("nick")
     self.assertEqual(hostmask.nickname, "nick")
     self.assertIsNone(hostmask.username)
     self.assertIsNone(hostmask.hostname)
예제 #5
0
 def test_none(self):
     hostmask = irctokens.Hostmask(None)
     self.assertIsNone(hostmask.nickname)
     self.assertIsNone(hostmask.username)
     self.assertIsNone(hostmask.hostname)