def test_delayed_command_order():
 null = (lambda : None)
 delays = [random.randint(0, 99) for x in range(5)]
 cmds = sorted([schedule.DelayedCommand.after(delay, null) for delay in delays])
 assert ([c.delay.seconds for c in cmds] == sorted(delays))

def test_delayed_command_order ( ) : null = ( lambda : None ) delays = [ random . randint ( 0 , 99 ) for x in range ( 5 ) ] cmds = sorted ( [ schedule . DelayedCommand . after ( delay , null ) for delay in delays ] ) assert ( [ c . delay . seconds for c in cmds ] == sorted ( delays ) )
delayed commands should be sorted by delay time .