Skip to content

Commit 7aedefd

Browse files
committed
wip
1 parent 216b210 commit 7aedefd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/nrfcredstore/at_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, comms : Comms):
2121
def __at_command_ok(self, cmd):
2222
"""Send AT command and return a bool whether the modem response was OK/ERROR."""
2323
try:
24-
self.at_command(cmd)
24+
return 'OK' in self.at_command(cmd)
2525
except ATCommandError as err:
2626
print(err)
2727
return False

tests/test_at_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ def at_client(self):
2424

2525
@pytest.fixture
2626
def ok_resp(self, at_client):
27-
self.comms.read_line.return_value = 'OK\r\n'
27+
self.comms.read_line.return_value = 'OK'
2828

2929
@pytest.fixture
3030
def not_at_client_resp(self, at_client):
3131
self.comms.read_line.side_effect = ['AT: command not found', '']
3232

3333
@pytest.fixture
3434
def error_resp(self, at_client):
35-
self.comms.read_line.return_value = 'ERROR\r\n'
35+
self.comms.read_line.return_value = 'ERROR'
3636

3737
@pytest.fixture
3838
def error_code_resp(self, at_client):
39-
self.comms.read_line.return_value = '+CME ERROR: 514\r\n'
39+
self.comms.read_line.return_value = '+CME ERROR: 514'
4040

4141
@pytest.fixture
4242
def error_code_0_resp(self, at_client):
43-
self.comms.read_line.return_value = '+CME ERROR: 0\r\n'
43+
self.comms.read_line.return_value = '+CME ERROR: 0'
4444

4545
@pytest.fixture
4646
def error_ok_resp(self, at_client):

0 commit comments

Comments
 (0)