def should_not_receive_reply_for(self, obj): for i in xrange(TIMEOUT_SECS): reply, _ = reply_for_object(obj, self.sock, timeout_secs=1.0) if reply is not None: raise Exception("Unexpectedly received reply for object")
def receive_reply_for(self, obj): reply, _ = reply_for_object(obj, self.sock, timeout_secs=TIMEOUT_SECS) if reply is None: raise Exception("Didn't receive reply for object") return reply