def do_accept(self, packet, seq): packet.seq = seq self.door.update(packet.toMessage(self.key)) return self.input_queue.get(block = False)
def do_not_accept(self, packet, seq): packet.seq = seq self.door.update(packet.toMessage(self.key))
def do_not_accept_test(self, packet, seq): packet.seq = seq self.assertFalse(self.door.update(packet.toMessage(self.key))) self.assertTrue(self.input_queue.empty(), "Message with seq nr %d was accepted" % seq)
def do_accept_test(self, packet, seq): packet.seq = seq self.assertTrue(self.door.update(packet.toMessage(self.key))) self.assertTrue(not self.input_queue.empty(), "Message with seq nr %d was not accepted" % seq) return self.input_queue.get(block = False)
def do_accept(self, packet, seq): packet.seq = seq self.door.update(packet.toMessage(self.key)) return self.input_queue.get(block=False)
def do_accept_test(self, packet, seq): packet.seq = seq self.assertTrue(self.door.update(packet.toMessage(self.key))) self.assertTrue(not self.input_queue.empty(), "Message with seq nr %d was not accepted" % seq) return self.input_queue.get(block=False)