1515import meshtastic .radioconfig_pb2
1616from ..serial_interface import SerialInterface
1717from ..tcp_interface import TCPInterface
18- from ..ble_interface import BLEInterface
18+ # from ..ble_interface import BLEInterface
1919from ..node import Node
2020from ..channel_pb2 import Channel
2121from ..remote_hardware import onGPIOreceive
@@ -220,23 +220,24 @@ def mock_showInfo():
220220 mo .assert_called ()
221221
222222
223- @pytest .mark .unit
224- def test_main_info_with_ble_interface (capsys , reset_globals ):
225- """Test --info"""
226- sys .argv = ['' , '--info' , '--ble' , 'foo' ]
227- Globals .getInstance ().set_args (sys .argv )
228-
229- iface = MagicMock (autospec = BLEInterface )
230- def mock_showInfo ():
231- print ('inside mocked showInfo' )
232- iface .showInfo .side_effect = mock_showInfo
233- with patch ('meshtastic.ble_interface.BLEInterface' , return_value = iface ) as mo :
234- main ()
235- out , err = capsys .readouterr ()
236- assert re .search (r'Connected to radio' , out , re .MULTILINE )
237- assert re .search (r'inside mocked showInfo' , out , re .MULTILINE )
238- assert err == ''
239- mo .assert_called ()
223+ # TODO: comment out ble (for now)
224+ #@pytest.mark.unit
225+ #def test_main_info_with_ble_interface(capsys, reset_globals):
226+ # """Test --info"""
227+ # sys.argv = ['', '--info', '--ble', 'foo']
228+ # Globals.getInstance().set_args(sys.argv)
229+ #
230+ # iface = MagicMock(autospec=BLEInterface)
231+ # def mock_showInfo():
232+ # print('inside mocked showInfo')
233+ # iface.showInfo.side_effect = mock_showInfo
234+ # with patch('meshtastic.ble_interface.BLEInterface', return_value=iface) as mo:
235+ # main()
236+ # out, err = capsys.readouterr()
237+ # assert re.search(r'Connected to radio', out, re.MULTILINE)
238+ # assert re.search(r'inside mocked showInfo', out, re.MULTILINE)
239+ # assert err == ''
240+ # mo.assert_called()
240241
241242
242243@pytest .mark .unit
@@ -1382,6 +1383,10 @@ def test_main_export_config(reset_globals, capsys):
13821383position_flags: 35"""
13831384 export_config (mo )
13841385 out , err = capsys .readouterr ()
1386+
1387+ # ensure we do not output this line
1388+ assert not re .search (r'Connected to radio' , out , re .MULTILINE )
1389+
13851390 assert re .search (r'owner: foo' , out , re .MULTILINE )
13861391 assert re .search (r'channel_url: bar' , out , re .MULTILINE )
13871392 assert re .search (r'location:' , out , re .MULTILINE )
@@ -1407,7 +1412,7 @@ def test_main_export_config_called_from_main(capsys, reset_globals):
14071412 with patch ('meshtastic.serial_interface.SerialInterface' , return_value = iface ) as mo :
14081413 main ()
14091414 out , err = capsys .readouterr ()
1410- assert re .search (r'Connected to radio' , out , re .MULTILINE )
1415+ assert not re .search (r'Connected to radio' , out , re .MULTILINE )
14111416 assert re .search (r'# start of Meshtastic configure yaml' , out , re .MULTILINE )
14121417 assert err == ''
14131418 mo .assert_called ()
0 commit comments