Beispiel #1
0
 def test_interval(self):
     # TODO: should be test better when async will be available
     interval = 2
     p = (umit.umpa.Packet(IP()), umit.umpa.Packet(IP()))
     before = int(time.time())
     schedule.send(0, p, interval=interval)
     after = int(time.time())
     assert after-before >= interval*len(p)
Beispiel #2
0
 def test_extra_args(self):
     schedule.send(0, umit.umpa.Packet(IP()))
     schedule.send(0, (umit.umpa.Packet(IP()), umit.umpa.Packet(IP())))
     schedule.send(0, [umit.umpa.Packet(IP()), umit.umpa.Packet(IP())])
     schedule.send(0, (umit.umpa.Packet(IP()), umit.umpa.Packet(IP())),
                                                         umit.umpa.Packet(IP()))
     schedule.send(0, (umit.umpa.Packet(IP()), umit.umpa.Packet(IP())),
                                     umit.umpa.Packet(IP()), umit.umpa.Packet(IP()))
Beispiel #3
0
 def test_delay(self):
     delay = 2
     before = int(time.time())
     schedule.send(delay)
     after = int(time.time())
     assert after-before >= delay