Esempio n. 1
0
 def test_server_ping(self):
     """
     Ensure the function from server module pings correctly.
     """
     response = server.ping()
     self.assertIsNotNone(response)
     self.assertEqual(EventResponse.OK, response.status,
                      'Wrong response status.')
Esempio n. 2
0
def ping_server(port=server.SERVER_PORT, reqcbk=None, timeout=1000):
    """
    Ping the server.

    :param port: the port in which server should be listening
    :type port: int
    :param reqcbk: a callback to be called when a response from server is
                   received
    :type reqcbk: function(proto.PingRequest, proto.EventResponse)
    :param timeout: the timeout for synch calls
    :type timeout: int
    """
    return server.ping(port, reqcbk=reqcbk, timeout=timeout)