<s> import time <EOL> import sys <EOL> import os <EOL> from dronekit import connect , VehicleMode <EOL> from dronekit . test import with_sitl <EOL> from nose . tools import assert_equals <EOL> @ with_sitl <EOL> def test_115 ( connpath ) : <EOL> v = connect ( connpath , wait_ready = True ) <EOL> def mavlink_callback ( * args ) : <EOL> mavlink_callback . count += <NUM_LIT:1> <EOL> mavlink_callback . count = <NUM_LIT:0> <EOL> v . add_message_listener ( '<STR_LIT:*>' , mavlink_callback ) <EOL> v . mode = VehicleMode ( "<STR_LIT>" ) <EOL> time . sleep ( <NUM_LIT:3> ) <EOL> assert mavlink_callback . count > <NUM_LIT:0> <EOL> v . remove_message_listener ( '<STR_LIT:*>' , mavlink_callback ) <EOL> savecount = mavlink_callback . count <EOL> v . armed = False <EOL> time . sleep ( <NUM_LIT:3> ) <EOL> assert_equals ( savecount , mavlink_callback . count ) <EOL> v . armed = True <EOL> time . sleep ( <NUM_LIT:3> ) <EOL> v . close ( ) </s>
