@with_sitl
def test_227(connpath):
 vehicle = connect(connpath, wait_ready=True)
 def assert_commands(count):
  vehicle.commands.download()
  vehicle.commands.wait_ready()
  assert_equals(len(vehicle.commands), count)
 assert_commands(0)
 vehicle.commands.add(Command(0, 0, 0, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT, mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 0, 0, 0, 0, 0, 0, 10, 10, 10))
 vehicle.flush()
 assert_commands(1)

@ with_sitl def test_227 ( connpath ) : vehicle = connect ( connpath , wait_ready = True ) def assert_commands ( count ) : vehicle . commands . download ( ) vehicle . commands . wait_ready ( ) assert_equals ( len ( vehicle . commands ) , count ) assert_commands ( 0 ) vehicle . commands . add ( Command ( 0 , 0 , 0 , mavutil . mavlink . MAV_FRAME_GLOBAL_RELATIVE_ALT , mavutil . mavlink . MAV_CMD_NAV_WAYPOINT , 0 , 0 , 0 , 0 , 0 , 0 , 10 , 10 , 10 ) ) vehicle . flush ( ) assert_commands ( 1 )
tests race condition when downloading items .