mirror of
https://github.com/meshtastic/python.git
synced 2026-05-19 05:46:14 -04:00
Remove --sendping as REPLY_APP portnum is disabled in firmware now
This commit is contained in:
@@ -713,31 +713,6 @@ def test_main_sendtext_with_dest(capsys, caplog, iface_with_nodes):
|
||||
assert err == ""
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
@pytest.mark.usefixtures("reset_globals")
|
||||
def test_main_sendping(capsys):
|
||||
"""Test --sendping"""
|
||||
sys.argv = ["", "--sendping"]
|
||||
Globals.getInstance().set_args(sys.argv)
|
||||
|
||||
iface = MagicMock(autospec=SerialInterface)
|
||||
|
||||
def mock_sendData(payload, dest, portNum, wantAck, wantResponse):
|
||||
print("inside mocked sendData")
|
||||
print(f"{payload} {dest} {portNum} {wantAck} {wantResponse}")
|
||||
|
||||
iface.sendData.side_effect = mock_sendData
|
||||
|
||||
with patch("meshtastic.serial_interface.SerialInterface", return_value=iface) as mo:
|
||||
main()
|
||||
out, err = capsys.readouterr()
|
||||
assert re.search(r"Connected to radio", out, re.MULTILINE)
|
||||
assert re.search(r"Sending ping message", out, re.MULTILINE)
|
||||
assert re.search(r"inside mocked sendData", out, re.MULTILINE)
|
||||
assert err == ""
|
||||
mo.assert_called()
|
||||
|
||||
|
||||
@pytest.mark.unit
|
||||
@pytest.mark.usefixtures("reset_globals")
|
||||
def test_main_setlat(capsys):
|
||||
|
||||
@@ -40,15 +40,6 @@ def test_smoke1_info():
|
||||
assert return_value == 0
|
||||
|
||||
|
||||
@pytest.mark.smoke1
|
||||
def test_smoke1_sendping():
|
||||
"""Test --sendping"""
|
||||
return_value, out = subprocess.getstatusoutput("meshtastic --sendping")
|
||||
assert re.match(r"Connected to radio", out)
|
||||
assert re.search(r"^Sending ping message", out, re.MULTILINE)
|
||||
assert return_value == 0
|
||||
|
||||
|
||||
@pytest.mark.smoke1
|
||||
def test_get_with_invalid_setting():
|
||||
"""Test '--get a_bad_setting'."""
|
||||
|
||||
@@ -50,17 +50,6 @@ def test_smokevirt_info():
|
||||
assert return_value == 0
|
||||
|
||||
|
||||
@pytest.mark.smokevirt
|
||||
def test_smokevirt_sendping():
|
||||
"""Test --sendping"""
|
||||
return_value, out = subprocess.getstatusoutput(
|
||||
"meshtastic --host localhost --sendping"
|
||||
)
|
||||
assert re.match(r"Connected to radio", out)
|
||||
assert re.search(r"^Sending ping message", out, re.MULTILINE)
|
||||
assert return_value == 0
|
||||
|
||||
|
||||
@pytest.mark.smokevirt
|
||||
def test_get_with_invalid_setting():
|
||||
"""Test '--get a_bad_setting'."""
|
||||
|
||||
Reference in New Issue
Block a user