File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments