mirror of
https://github.com/okalachev/flix.git
synced 2026-09-06 00:10:58 +00:00
Make failed mavlink commands exception more verbose in pytflix
This commit is contained in:
+5
-2
@@ -46,5 +46,8 @@ def test():
|
||||
flix.set_mode('AUTO')
|
||||
flix.wait('mode', 'AUTO')
|
||||
|
||||
raises(RuntimeError, lambda: flix._command_send(mavlink.MAV_CMD_DO_SET_MODE, [0, 99, 0, 0, 0, 0, 0])) # invalid mode
|
||||
raises(RuntimeError, lambda: flix._command_send(mavlink.MAV_CMD_DO_PARACHUTE, [0, 0, 0, 0, 0, 0, 0])) # unsupported command
|
||||
print("=== Check command errors")
|
||||
with raises(RuntimeError, match='MAV_RESULT_DENIED'):
|
||||
flix._command_send(mavlink.MAV_CMD_DO_SET_MODE, [0, 99, 0, 0, 0, 0, 0]) # invalid mode
|
||||
with raises(RuntimeError, match='MAV_RESULT_UNSUPPORTED'):
|
||||
flix._command_send(mavlink.MAV_CMD_DO_PARACHUTE, [0, 0, 0, 0, 0, 0, 0]) # unsupported command
|
||||
|
||||
Reference in New Issue
Block a user