()
| 317 | |
| 318 | #[test] |
| 319 | fn test_cached_paths() { |
| 320 | let opts = TlsOptions::default(); |
| 321 | |
| 322 | assert!(opts.cached_cert_path().is_none()); |
| 323 | assert!(opts.cached_key_path().is_none()); |
| 324 | assert!(opts.cached_ca_path().is_none()); |
| 325 | |
| 326 | create_test_file( |
| 327 | "../../tests/certs/cert.pem", |
| 328 | &opts.config_dir.join("cert.pem"), |
| 329 | ); |
| 330 | create_test_file( |
| 331 | "../../tests/certs/key.pem", |
| 332 | &opts.config_dir.join("key.pem"), |
| 333 | ); |
| 334 | create_test_file("../../tests/certs/ca.pem", &opts.config_dir.join("ca.pem")); |
| 335 | |
| 336 | assert_eq!( |
| 337 | opts.cached_cert_path().unwrap(), |
| 338 | opts.config_dir.join("cert.pem") |
| 339 | ); |
| 340 | assert_eq!( |
| 341 | opts.cached_key_path().unwrap(), |
| 342 | opts.config_dir.join("key.pem") |
| 343 | ); |
| 344 | assert_eq!( |
| 345 | opts.cached_ca_path().unwrap(), |
| 346 | opts.config_dir.join("ca.pem") |
| 347 | ); |
| 348 | } |
| 349 | |
| 350 | #[tokio::test] |
| 351 | async fn test_server_config_with_valid_files_in_temp_dir() { |
nothing calls this directly
no test coverage detected