@@ -86,31 +86,6 @@ def test_sftp_cert(self, mock_write_cert, mock_get_keys, mock_abspath, mock_isdi
8686 mock_get_keys .assert_called_once_with ('/pubkey/path' , None , None , None )
8787 mock_write_cert .assert_called_once_with (cmd , 'pubkey' , '/cert/path' , None )
8888
89- def test_sftp_connect_preprod (self ):
90- """Test SFTP connection to preprod environment.
91-
92- Owner: johnli1
93- """
94- cmd = mock .Mock ()
95- cmd .cli_ctx = mock .Mock ()
96- cmd .cli_ctx .cloud = mock .Mock ()
97- cmd .cli_ctx .cloud .name = "azurecloud"
98-
99- # Create a temporary batch file for automated testing
100- batch_file = os .path .join (self .temp_dir , "test_batch.txt" )
101- with open (batch_file , 'w' ) as f :
102- f .write ("pwd\n ls\n exit\n " )
103-
104- # Use batch file to avoid interactive prompt
105- custom .sftp_connect (
106- cmd = cmd ,
107- storage_account = 'johnli1canary' ,
108- port = 22 ,
109- cert_file = 'C:\\ Users\\ johnli1\\ .ssh\\ id_rsa-aadcert.pub' ,
110- sftp_args = ['-b' , batch_file ] # Use actual batch file
111- )
112- self .assertTrue (True )
113-
11489 @mock .patch ('azext_sftp.custom._do_sftp_op' )
11590 @mock .patch ('azext_sftp.sftp_utils.get_ssh_cert_principals' )
11691 def test_sftp_connect_certificate_scenarios (self , mock_get_principals , mock_do_sftp ):
@@ -713,7 +688,7 @@ def test_sftp_cert_error_cases(self):
713688 """Test sftp cert error handling with invalid argument combinations."""
714689 # Test cases: (cert_path, public_key_file, setup_mocks, expected_exception, expected_message, description)
715690 test_cases = [
716- (None , None , {}, azclierror .RequiredArgumentMissingError , "--output- file or --public-key-file must be provided" , "no_arguments" ),
691+ (None , None , {}, azclierror .RequiredArgumentMissingError , "--file or --public-key-file must be provided" , "no_arguments" ),
717692 ("/bad/cert.pub" , None , {"expanduser_return" : "/bad/cert.pub" , "isdir_return" : False }, azclierror .InvalidArgumentValueError , "folder doesn't exist" , "invalid_directory" ),
718693 ]
719694
0 commit comments