MCPcopy
hub / github.com/dronekit/dronekit-python / test_227

Function test_227

dronekit/test/sitl/test_waypoints.py:122–141  ·  view source on GitHub ↗

Tests race condition when downloading items

(connpath)

Source from the content-addressed store, hash-verified

120
121@with_sitl
122def test_227(connpath):
123 """
124 Tests race condition when downloading items
125 """
126
127 vehicle = connect(connpath, wait_ready=True)
128
129 def assert_commands(count):
130 vehicle.commands.download()
131 vehicle.commands.wait_ready()
132 assert_equals(len(vehicle.commands), count)
133
134 assert_commands(0)
135
136 vehicle.commands.add(Command(0, 0, 0, mavutil.mavlink.MAV_FRAME_GLOBAL_RELATIVE_ALT,
137 mavutil.mavlink.MAV_CMD_NAV_WAYPOINT, 0, 0, 0, 0, 0, 0, 10, 10,
138 10))
139 vehicle.flush() # Send commands
140
141 assert_commands(1)

Callers

nothing calls this directly

Calls 5

connectFunction · 0.90
CommandClass · 0.90
assert_commandsFunction · 0.85
addMethod · 0.80
flushMethod · 0.80

Tested by

no test coverage detected