MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / test_search_load_config_nested

Function test_search_load_config_nested

load_config/src/lib.rs:280–311  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

278
279 #[test]
280 fn test_search_load_config_nested() {
281 let temp_dir = TempDir::new().unwrap();
282 let dir_path = temp_dir.path().to_str().unwrap();
283
284 // Write nested configuration
285 fs::write(
286 temp_dir.path().join("app.toml"),
287 r#"
288[config]
289override = "nested_from_toml"
290"#,
291 )
292 .unwrap();
293
294 let default_toml = r#"
295[config]
296foo = "nested_value"
297override = "default"
298"#;
299
300 let result =
301 search_load_config("app", &[dir_path], default_toml, None, true).select("config");
302
303 assert_eq!(
304 result.extract_inner::<String>("foo").unwrap(),
305 "nested_value"
306 );
307 assert_eq!(
308 result.extract_inner::<String>("override").unwrap(),
309 "nested_from_toml"
310 );
311 }
312}

Callers

nothing calls this directly

Calls 2

search_load_configFunction · 0.85
pathMethod · 0.80

Tested by

no test coverage detected