def test_ISockBasic(self): client = isock.Client("localhost",4440) data_to_send = "dummy" received_data = client.runAction(_echo,data_to_send) self.assertEqual(data_to_send,received_data) received_data = client.runAction(_serverVar) self.assertEqual("dummy",received_data)
def test_ISockActionException(self): client = isock.Client("localhost",4446) data_to_send = "dummy" with self.assertRaises(isock.ClientException): received_data = client.runAction(_echo(),data_to_send) with self.assertRaises(isock.ClientException): received_data = client.runAction(None,data_to_send)
def test_ISockAction(self): client = isock.Client("localhost",4445) data_to_send = "dummy" with self.assertRaises(isock.ServerException): received_data = client.runAction(_echo,data_to_send) self.server.addAction(_echo()) received_data = client.runAction(_echo,data_to_send) self.assertEqual(data_to_send,received_data)
def test_ISockClientRetry(self): client = isock.Client("localhost",4444) with self.assertRaises(isock.ClientException): received_data = client.runAction(_echo)