def setUp(self): self.clock = Clock() monkey_patcher.addPatch(krpc_responder, "time", self.clock) monkey_patcher.patch() self.address = ("127.0.0.1", 5555) # Attach a standard test query query = Query() query._from = 15125 query.rpctype = "get_peers" query.target_id = 90809 self.query = query # The token generator that will be tested self.tgen = _TokenGenerator()
def setUp(self): # Reach into the contact module and replace # its time function with a custom one self.clock = Clock() monkey_patcher.addPatch(contact, "time", self.clock) monkey_patcher.patch()