MCPcopy Create free account
hub / github.com/cargo-lambda/cargo-lambda / test_tls_options_default

Function test_tls_options_default

crates/cargo-lambda-remote/src/tls.rs:271–293  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

269
270 #[tokio::test]
271 async fn test_tls_options_default() {
272 let opts = TlsOptions::default();
273 assert!(!opts.is_secure());
274
275 create_test_file(
276 "../../tests/certs/cert.pem",
277 &opts.config_dir.join("cert.pem"),
278 );
279 create_test_file(
280 "../../tests/certs/key.pem",
281 &opts.config_dir.join("key.pem"),
282 );
283 create_test_file("../../tests/certs/ca.pem", &opts.config_dir.join("ca.pem"));
284
285 // Should return temp paths in test mode
286 assert_eq!(opts.cert_path().unwrap(), opts.config_dir.join("cert.pem"));
287 assert_eq!(opts.key_path().unwrap(), opts.config_dir.join("key.pem"));
288 assert_eq!(opts.ca_path().unwrap(), opts.config_dir.join("ca.pem"));
289 assert!(opts.is_secure());
290
291 let config = opts.server_config().unwrap();
292 assert!(config.is_some());
293 }
294
295 #[test]
296 fn test_tls_options_with_paths() {

Callers

nothing calls this directly

Calls 2

create_test_fileFunction · 0.85
server_configMethod · 0.80

Tested by

no test coverage detected