File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -728,7 +728,7 @@ def factoryReset(self, full: bool = False):
728728 self .ensureSessionKey ()
729729 p = admin_pb2 .AdminMessage ()
730730 if full :
731- p .factory_reset_device = True
731+ p .factory_reset_device = 1
732732 logger .info (f"Telling node to factory reset (full device reset)" )
733733 else :
734734 p .factory_reset_config = 1
Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ def test_factoryReset_config_uses_int_field():
269269 anode = Node (iface , 1234567890 , noProto = True )
270270
271271 amesg = admin_pb2 .AdminMessage ()
272- with patch ("meshtastic.admin_pb2.AdminMessage" , return_value = amesg ):
272+ with patch ("meshtastic.node. admin_pb2.AdminMessage" , return_value = amesg ):
273273 with patch .object (anode , "_sendAdmin" ) as mock_send_admin :
274274 anode .factoryReset (full = False )
275275
@@ -284,11 +284,11 @@ def test_factoryReset_full_sets_device_field():
284284 anode = Node (iface , 1234567890 , noProto = True )
285285
286286 amesg = admin_pb2 .AdminMessage ()
287- with patch ("meshtastic.admin_pb2.AdminMessage" , return_value = amesg ):
287+ with patch ("meshtastic.node. admin_pb2.AdminMessage" , return_value = amesg ):
288288 with patch .object (anode , "_sendAdmin" ) as mock_send_admin :
289289 anode .factoryReset (full = True )
290290
291- assert amesg .factory_reset_device is True
291+ assert amesg .factory_reset_device == 1
292292 mock_send_admin .assert_called_once_with (amesg , onResponse = anode .onAckNak )
293293
294294
You can’t perform that action at this time.
0 commit comments