From 0c924601631a005cffa4b36a7eff32a348932dee Mon Sep 17 00:00:00 2001 From: Mike Kinney Date: Mon, 11 Apr 2022 13:58:56 -0700 Subject: [PATCH] got smoke1 tests to pass --- meshtastic/tests/test_smoke1.py | 48 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/meshtastic/tests/test_smoke1.py b/meshtastic/tests/test_smoke1.py index 8579051..e65f952 100644 --- a/meshtastic/tests/test_smoke1.py +++ b/meshtastic/tests/test_smoke1.py @@ -234,6 +234,30 @@ def test_smoke1_set_team(): assert return_value == 0 +@pytest.mark.smoke1 +def test_smoke1_ch_set_modem_config(): + """Test --ch-set modem_config""" + return_value, out = subprocess.getstatusoutput('meshtastic --ch-set modem_config MidFast') + assert re.search(r'Warning: Need to specify', out, re.MULTILINE) + assert return_value == 1 + # pause for the radio + time.sleep(PAUSE_AFTER_COMMAND) + return_value, out = subprocess.getstatusoutput('meshtastic --info') + assert not re.search(r'MidFast', out, re.MULTILINE) + assert return_value == 0 + # pause for the radio + time.sleep(PAUSE_AFTER_COMMAND) + return_value, out = subprocess.getstatusoutput('meshtastic --ch-set modem_config MidFast --ch-index 0') + assert re.match(r'Connected to radio', out) + assert re.search(r'^Set modem_config to MidFast', out, re.MULTILINE) + assert return_value == 0 + # pause for the radio + time.sleep(PAUSE_AFTER_REBOOT) + return_value, out = subprocess.getstatusoutput('meshtastic --info') + assert re.search(r'MidFast', out, re.MULTILINE) + assert return_value == 0 + + @pytest.mark.smoke1 def test_smoke1_ch_values(): """Test --ch-vlongslow --ch-longslow, --ch-longfast, --ch-mediumslow, --ch-mediumsfast, @@ -550,30 +574,6 @@ def test_smoke1_ensure_ch_del_third_of_three_channels(): time.sleep(PAUSE_AFTER_COMMAND) -@pytest.mark.smoke1 -def test_smoke1_ch_set_modem_config(): - """Test --ch-set modem_config""" - return_value, out = subprocess.getstatusoutput('meshtastic --ch-set modem_config Bw31_25Cr48Sf512') - assert re.search(r'Warning: Need to specify', out, re.MULTILINE) - assert return_value == 1 - # pause for the radio - time.sleep(PAUSE_AFTER_COMMAND) - return_value, out = subprocess.getstatusoutput('meshtastic --info') - assert not re.search(r'ShortFast', out, re.MULTILINE) - assert return_value == 0 - # pause for the radio - time.sleep(PAUSE_AFTER_COMMAND) - return_value, out = subprocess.getstatusoutput('meshtastic --ch-set modem_config ShortFast --ch-index 0') - assert re.match(r'Connected to radio', out) - assert re.search(r'^Set modem_config to ShortFast', out, re.MULTILINE) - assert return_value == 0 - # pause for the radio - time.sleep(PAUSE_AFTER_COMMAND) - return_value, out = subprocess.getstatusoutput('meshtastic --info') - assert re.search(r'ShortFast', out, re.MULTILINE) - assert return_value == 0 - - @pytest.mark.smoke1 def test_smoke1_seturl_default(): """Test --seturl with default value"""