예제 #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)
예제 #2
0
 def do_not_accept(self, packet, seq):
     packet.seq = seq
     self.door.update(packet.toMessage(self.key))
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #7
0
 def do_not_accept(self, packet, seq):
     packet.seq = seq
     self.door.update(packet.toMessage(self.key))
예제 #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)