Exemplo n.º 1
0
    def _setup(self):
        global time
        time = querier.time = MockTime()

        self.ping_msg = message.OutgoingPingQuery(tc.CLIENT_ID)
        ping_r_out = message.OutgoingPingResponse(tc.SERVER_ID)
        self.ping_r_in = message.IncomingMsg(ping_r_out.encode(tc.TID),
                                             tc.SERVER_ADDR)
        fn_r_out = message.OutgoingFindNodeResponse(tc.SERVER_ID,
                                                    nodes2=tc.NODES)
        self.fn_r_in = message.IncomingMsg(fn_r_out.encode(tc.TID),
                                           tc.SERVER_ADDR)

        self.got_response = False
        self.got_error = False
        self.got_timeout = False

        self.got_routing_response = False
        self.got_routing_error = False
        self.got_routing_timeout = False
        self.got_routing_nodes_found = False

        timeout_task = minitwisted.Task(1, self.on_timeout, tc.SERVER_NODE)
        self.query = querier.Query(tc.TID, self.ping_msg.query, tc.SERVER_NODE,
                                   timeout_task)
Exemplo n.º 2
0
    def setup(self):
        import rpc_manager
        global time

        time = minitwisted.time = querier.time = MockTime()

        self.got_response = False
        self.got_timeout = False
        self.got_error = False

        self.querier = querier.Querier(tc.CLIENT_ID)

        self.r = minitwisted.ThreadedReactor(task_interval=.01)
        self.rpc_m = rpc_manager.RPCManager(self.r)
        self.querier = querier.Querier(tc.CLIENT_NODE)
        self.r.start()
Exemplo n.º 3
0
 def setup(self):
     global time
     time = minitwisted.time = MockTime()
     # Order in which callbacks have been fired
     self.callback_order = []
     self.task_m = TaskManager()
Exemplo n.º 4
0
 def setup(self):
     global time
     time = floodbarrier.time = MockTime()
Exemplo n.º 5
0
 def setup(self):
     global time
     time = querier.time = MockTime()
     self.querier = Querier(tc.CLIENT_ID)
Exemplo n.º 6
0
 def setup(self):
     global time
     time = querier.time = MockTime()
Exemplo n.º 7
0
 def setup(self):
     global time
     time = tracker.time = MockTime()
     self.t = tracker.Tracker(VALIDITY_PERIOD, CLEANUP_COUNTER)