human
Solve the following python programming problem given the following code:
@with_sitl
def test_227(connpath):
assistant
#Here is the Python program you requested.

    """Tests race condition when downloading items
    """
    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)