Skip to content

Commit ee857c5

Browse files
authored
Merge pull request #588 from nerdenator/quick-coverage
quick-coverage: simple test case just to cover uncovered code.
2 parents b350b9e + 87a4bb0 commit ee857c5

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

meshtastic/tests/test_util.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
stripnl,
3434
support_info,
3535
message_to_json,
36+
Acknowledgment
3637
)
3738

3839

@@ -555,3 +556,24 @@ def test_message_to_json_shows_all():
555556
actual = json.loads(message_to_json(MyNodeInfo()))
556557
expected = { "myNodeNum": 0, "rebootCount": 0, "minAppVersion": 0 }
557558
assert actual == expected
559+
560+
@pytest.mark.unit
561+
def test_acknowledgement_reset():
562+
"""
563+
Test that the reset method can set all fields back to False
564+
"""
565+
test_ack_obj = Acknowledgment()
566+
# everything's set to False; let's set it to True to get a good test
567+
test_ack_obj.receivedAck = True
568+
test_ack_obj.receivedNak = True
569+
test_ack_obj.receivedImplAck = True
570+
test_ack_obj.receivedTraceRoute = True
571+
test_ack_obj.receivedTelemetry = True
572+
test_ack_obj.receivedPosition = True
573+
test_ack_obj.reset()
574+
assert test_ack_obj.receivedAck is False
575+
assert test_ack_obj.receivedNak is False
576+
assert test_ack_obj.receivedImplAck is False
577+
assert test_ack_obj.receivedTraceRoute is False
578+
assert test_ack_obj.receivedTelemetry is False
579+
assert test_ack_obj.receivedPosition is False

0 commit comments

Comments
 (0)