From f7d8994ce1af85032b09cc36ae36d3935ffe765b Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 1 Mar 2021 11:54:34 +1100 Subject: [PATCH] autotest: move assert_mission_count up, use it --- Tools/autotest/arducopter.py | 9 --------- Tools/autotest/common.py | 12 ++++++++++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Tools/autotest/arducopter.py b/Tools/autotest/arducopter.py index 7823858ee1..cb8de133fb 100644 --- a/Tools/autotest/arducopter.py +++ b/Tools/autotest/arducopter.py @@ -5694,15 +5694,6 @@ class AutoTestCopter(AutoTest): if ex is not None: raise ex - def get_mission_count(self): - return self.get_parameter("MIS_TOTAL") - - def assert_mission_count(self, expected): - count = self.get_mission_count() - if count != expected: - raise NotAchievedException("Unexpected count got=%u want=%u" % - (count, expected)) - def test_aux_switch_options(self): self.set_parameter("RC7_OPTION", 58) # clear waypoints self.load_mission("copter_loiter_to_alt.txt") diff --git a/Tools/autotest/common.py b/Tools/autotest/common.py index e433f20e76..80d43b798b 100644 --- a/Tools/autotest/common.py +++ b/Tools/autotest/common.py @@ -2691,6 +2691,15 @@ class AutoTest(ABC): self.set_rc(ch, 1000) self.delay_sim_time(1) + def get_mission_count(self): + return self.get_parameter("MIS_TOTAL") + + def assert_mission_count(self, expected): + count = self.get_mission_count() + if count != expected: + raise NotAchievedException("Unexpected count got=%u want=%u" % + (count, expected)) + def clear_wp(self, ch=8): """Trigger RC Aux to clear waypoint.""" self.progress("Clearing waypoints") @@ -2699,8 +2708,7 @@ class AutoTest(ABC): self.set_rc(ch, 2000) self.delay_sim_time(0.5) self.set_rc(ch, 1000) - self.mavproxy.send('wp list\n') - self.mavproxy.expect('Requesting 0 waypoints') + self.assert_mission_count(0) def log_list(self): '''return a list of log files present in POSIX-style loging dir'''