예제 #1
0
파일: test.py 프로젝트: becdot/sockets_irc
 def test_send_exit(self):
     "An exit message sent from the client shuts down the socket and sets threads = False"
     client = Client()
     fakesock = FakeSocket()
     client.outgoing = fakesock
     client.send_message('exit')
     self.assertTrue(fakesock.shut)
     self.assertFalse(client.threads)
예제 #2
0
파일: test.py 프로젝트: becdot/sockets_irc
 def test_send_message(self):
     "Message is sent from the client to the server and sets threads = True"
     client = Client()
     fakesock = FakeSocket()
     client.outgoing = fakesock
     client.send_message('hello!')
     self.assertTrue(fakesock.did_message_send)
     self.assertTrue(client.threads)