Exemple #1
0
 def test_client_handles_353_names(self):
     channel = self.client.add_channel('#test')
     self.client.read_data(':server 353 kylef = #test :Derecho!der@der +Tempest!tmp@tmp dijit')
     self.assertEqual(len(channel.nicks), 3)
     self.assertEqual(channel.nicks[0], Nick.parse(self.client, 'Derecho!der@der'))
     self.assertEqual(channel.nicks[1], Nick.parse(self.client, 'Tempest!tmp@tmp'))
     self.assertEqual(channel.nicks[2], Nick(self.client, nick='dijit'))
     self.assertTrue(channel.nicks[1].has_perm('v'))
Exemple #2
0
 def test_nick_parsing_from_hostname(self):
     nick = Nick.parse(self.client, 'kylefuller.co.uk')
     self.assertEqual(nick.host, 'kylefuller.co.uk')
Exemple #3
0
 def test_nick_parsing_from_userhost(self):
     nick = Nick.parse(self.client, '[email protected]')
     self.assertEqual(nick.nick, 'kylef')
     self.assertEqual(nick.ident, 'kyle')
     self.assertEqual(nick.host, 'kylefuller.co.uk')
Exemple #4
0
 def test_client_forwards_private_messages_to_delegate(self):
     self.client.read_data(':[email protected] PRIVMSG kylef :Hey')
     self.assertEqual(self.private_messages,
         [(self.client, Nick.parse(self.client, '[email protected]'), 'Hey')])