Skip to content

Commit 98f910b

Browse files
committed
comms: test store string
Signed-off-by: Maximilian Deubel <[email protected]>
1 parent e1432de commit 98f910b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/test_comms.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,3 +444,11 @@ def test_expect_response_timeout(mock_serial):
444444
assert result is False
445445
assert output == ''
446446

447+
def test_expect_response_store(mock_serial):
448+
with patch("nrfcredstore.comms.select_device", return_value=(Mock(), "123456789")) as mock_select:
449+
comms = Comms()
450+
comms.read_line = Mock(side_effect=['%ATTESTTOKEN: "foo.bar"', "OK"])
451+
result, output = comms.expect_response("OK", "ERROR", "%ATTESTTOKEN: ")
452+
mock_select.assert_called_once()
453+
assert result is True
454+
assert output.strip() == '%ATTESTTOKEN: "foo.bar"'

0 commit comments

Comments
 (0)