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

Function test_search_load_config

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

Source from the content-addressed store, hash-verified

137
138 #[test]
139 fn test_search_load_config() {
140 let temp_dir = TempDir::new().unwrap();
141 let dir_path = temp_dir.path().to_str().unwrap();
142
143 fs::write(
144 temp_dir.path().join("app.toml"),
145 r#"override = "from_toml""#,
146 )
147 .unwrap();
148
149 let default_toml = r#"
150foo = "value"
151override = "default"
152"#;
153
154 let result = search_load_config("app", &[dir_path], default_toml, None, false);
155
156 assert_eq!(result.extract_inner::<String>("foo").unwrap(), "value");
157 assert_eq!(
158 result.extract_inner::<String>("override").unwrap(),
159 "from_toml"
160 );
161 }
162
163 #[test]
164 fn test_search_load_config2() {

Callers

nothing calls this directly

Calls 2

search_load_configFunction · 0.85
pathMethod · 0.80

Tested by

no test coverage detected