Example #1
0
 def do_accept(self, packet, seq):
     packet.seq = seq
     self.door.update(packet.toMessage(self.key))
     return self.input_queue.get(block = False)
Example #2
0
 def do_not_accept(self, packet, seq):
     packet.seq = seq
     self.door.update(packet.toMessage(self.key))
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
 def do_accept(self, packet, seq):
     packet.seq = seq
     self.door.update(packet.toMessage(self.key))
     return self.input_queue.get(block=False)
Example #6
0
 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)
Example #7
0
 def do_not_accept(self, packet, seq):
     packet.seq = seq
     self.door.update(packet.toMessage(self.key))
Example #8
0
 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)