File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1513,3 +1513,20 @@ def test_custom_reset_sequence(self):
1513
1513
output = self .run_esptool_error ("flash_id" )
1514
1514
assert f"Loaded custom configuration from { config_file_path } " in output
1515
1515
assert 'Invalid "custom_reset_sequence" option format:' in output
1516
+
1517
+ def test_open_port_attempts (self ):
1518
+ # Test that the open_port_attempts option is loaded correctly
1519
+ connect_attempts = 5
1520
+ config = (
1521
+ "[esptool]\n "
1522
+ f"open_port_attempts = { connect_attempts } \n "
1523
+ "connect_attempts = 1\n "
1524
+ "custom_reset_sequence = D0\n " # Invalid reset sequence to make sure connection fails
1525
+ )
1526
+ config_file_path = os .path .join (os .getcwd (), "esptool.cfg" )
1527
+ with self .ConfigFile (config_file_path , config ):
1528
+ output = self .run_esptool_error ("flash_id" )
1529
+ assert f"Loaded custom configuration from { config_file_path } " in output
1530
+ assert "Retrying failed connection" in output
1531
+ for _ in range (connect_attempts ):
1532
+ assert "Connecting........" in output
You can’t perform that action at this time.
0 commit comments