Beispiel #1
0
def test_get_config_error(runner, mock_rak811):
    mock_rak811.return_value.get_config.side_effect = Rak811ResponseError(-1)
    result = runner.invoke(cli, ['-v', 'get-config', 'nwks_key'])
    mock_rak811.return_value.get_config.assert_called_once()
    assert result.output == 'RAK811 response error -1: Invalid argument\n'
Beispiel #2
0
def test_join_abp_response(runner, mock_rak811):
    mock_rak811.return_value.join_abp.side_effect = Rak811ResponseError(-3)
    result = runner.invoke(cli, ['-v', 'join-abp'])
    mock_rak811.return_value.join_abp.assert_called_once()
    assert result.output == 'RAK811 response error -3: ABP join error\n'
Beispiel #3
0
def test_set_config_invalid(runner, mock_rak811):
    mock_rak811.return_value.set_config.side_effect = Rak811ResponseError(-1)
    result = runner.invoke(cli, ['-v', 'set-config', 'dr=0', 'adr=out'])
    mock_rak811.return_value.set_config.assert_called_once_with(dr='0',
                                                                adr='out')
    assert result.output == 'RAK811 response error -1: Invalid argument\n'