Пример #1
0
 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
 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)