Exemple #1
0
 def test_add_user(self):
     chan = Channel('#foobar')
     user = User('nick', 'host.com', 'ident')
     chan.add_user(user)
     self.assertEqual(user.nick, chan.find_nick_from_host(user.host))
     self.assertEqual(None, chan.find_nick_from_host('asdsaff'))
     self.assertEqual(user.host, chan.find_host_from_nick(user.nick))
     self.assertEqual(None, chan.find_host_from_nick('asdsaff'))
Exemple #2
0
	def test_add_user(self):
		chan = Channel('#foobar')
		user = User('nick', 'host.com', 'ident')
		chan.add_user(user)
		self.assertEqual(user.nick, chan.find_nick_from_host(user.host))
		self.assertEqual(None, chan.find_nick_from_host('asdsaff'))
		self.assertEqual(user.host, chan.find_host_from_nick(user.nick))
		self.assertEqual(None, chan.find_host_from_nick('asdsaff'))
Exemple #3
0
 def test_update_nick(self):
     chan = Channel('#foobar')
     user = User('oldnick', 'host.com', 'ident')
     chan.add_user(user)
     self.assertEqual(user.nick, chan.find_nick_from_host(user.host))
     self.assertEqual(user.host, chan.find_host_from_nick('oldnick'))
     user.name = 'newnick'
     self.assertEqual(None, chan.find_host_from_nick('oldnick'))
     self.assertEqual('newnick', chan.find_nick_from_host(user.host))
     self.assertEqual(user.host, chan.find_host_from_nick('newnick'))
Exemple #4
0
	def test_update_nick(self):
		chan = Channel('#foobar')
		user = User('oldnick', 'host.com', 'ident')
		chan.add_user(user)
		self.assertEqual(user.nick, chan.find_nick_from_host(user.host))
		self.assertEqual(user.host, chan.find_host_from_nick('oldnick'))
		user.name = 'newnick'
		self.assertEqual(None, chan.find_host_from_nick('oldnick'))
		self.assertEqual('newnick', chan.find_nick_from_host(user.host))
		self.assertEqual(user.host, chan.find_host_from_nick('newnick'))