File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -303,6 +303,7 @@ mod test_auth {
303303 }
304304
305305 #[ test]
306+ #[ ignore = "modifies the local filesystem" ]
306307 fn test_auth_cookie_file_get_user_pass ( ) {
307308 let temp_dir = std:: env:: temp_dir ( ) ;
308309 let cookie_path = temp_dir. join ( "test_auth_cookie" ) ;
@@ -318,4 +319,21 @@ mod test_auth {
318319
319320 std:: fs:: remove_file ( cookie_path) . ok ( ) ;
320321 }
322+
323+ #[ test]
324+ fn test_auth_none_returns_error ( ) {
325+ let result = Client :: with_auth ( "http://invalid-url" , Auth :: None ) ;
326+
327+ assert ! ( matches!( result, Err ( Error :: MissingAuthentication ) ) ) ;
328+ }
329+
330+ #[ test]
331+ fn test_auth_invalid_cookie_file ( ) {
332+ let dummy_url = "http://127.0.0.1:18443" ;
333+ let cookie_path = PathBuf :: from ( "/nonexistent/path/to/cookie" ) ;
334+
335+ let result = Client :: with_auth ( dummy_url, Auth :: CookieFile ( cookie_path) ) ;
336+
337+ assert ! ( matches!( result, Err ( Error :: InvalidCookieFile ) ) ) ;
338+ }
321339}
You can’t perform that action at this time.
0 commit comments