Exemple #1
0
 def send_query_and_get_timeout(self, querier):
     ping_msg = message.OutgoingPingQuery(tc.CLIENT_ID)
     query = querier.send_query(ping_msg, tc.DEAD_NODE,
                                self.on_response,
                                self.on_timeout, self.on_error,
                                timeout_delay=tc.TIMEOUT_DELAY)
     if querier is self.querier_mock:
         query.timeout_task.fire_callbacks()
     time.sleep(tc.TIMEOUT_DELAY + .1)
     assert not self.got_response and self.got_timeout
 def send_query_and_get_timeout(self, querier):
     ping_msg = message.OutgoingPingQuery(tc.CLIENT_ID)
     query = querier.send_query(ping_msg, tc.DEAD_NODE,
                                self.on_response,
                                self.on_timeout, self.on_error,
                                timeout_delay=tc.TIMEOUT_DELAY)
     if querier is self.querier_mock:
         query.timeout_task.fire_callbacks()
     time.sleep(tc.TIMEOUT_DELAY + .1)
     assert not self.got_response and self.got_timeout
Exemple #3
0
    def send_query_and_get_error(self, querier):


        ping_msg = message.OutgoingPingQuery()
        query = querier.send_query(ping_msg, tc.EXTERNAL_NODE,
                                   self.on_response,
                                   self.on_timeout, self.on_error,
                                   timeout_delay=tc.TIMEOUT_DELAY)
        if querier is self.querier_mock:
            # the server creates the response
            error_msg = message.OutgoingErrorMsg(ping_msg.tid,
                                                 message.GENERIC_E)
            error_data = error_msg.encode()
            # rpc_m decodes the response received
            _, _, error_msg_dict = message.decode(error_data)
            # rpc_m notifies of the message (callback)
            querier.on_error_received(error_msg_dict, tc.EXTERNAL_NODE)
        time.sleep(tc.TIMEOUT_DELAY + .1)
    def send_query_and_get_error(self, querier):


        ping_msg = message.OutgoingPingQuery()
        query = querier.send_query(ping_msg, tc.EXTERNAL_NODE,
                                   self.on_response,
                                   self.on_timeout, self.on_error,
                                   timeout_delay=tc.TIMEOUT_DELAY)
        if querier is self.querier_mock:
            # the server creates the response
            error_msg = message.OutgoingErrorMsg(ping_msg.tid,
                                                 message.GENERIC_E)
            error_data = error_msg.encode()
            # rpc_m decodes the response received
            _, _, error_msg_dict = message.decode(error_data)
            # rpc_m notifies of the message (callback)
            querier.on_error_received(error_msg_dict, tc.EXTERNAL_NODE)
        time.sleep(tc.TIMEOUT_DELAY + .1)