Beispiel #1
0
    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)
Beispiel #2
0
    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)
Beispiel #3
0
    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)
Beispiel #4
0
    def test_ISockClientRetry(self):
        client = isock.Client("localhost",4444)

        with self.assertRaises(isock.ClientException):
            received_data = client.runAction(_echo)