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

Function create_test_state

gateway/src/main_service/tests.rs:23–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23async fn create_test_state() -> TestState {
24 let figment = load_config_figment(None);
25 let mut config = figment.focus("core").extract::<Config>().unwrap();
26 let temp_dir = TempDir::new().expect("failed to create temp dir");
27 config.sync.data_dir = temp_dir.path().to_string_lossy().to_string();
28 let options = ProxyOptions {
29 config,
30 my_app_id: None,
31 tls_config: TlsConfig {
32 certs: "".to_string(),
33 key: "".to_string(),
34 mutual: MutualConfig {
35 ca_certs: "".to_string(),
36 },
37 },
38 };
39 let proxy = Proxy::new(options)
40 .await
41 .expect("failed to create app state");
42 TestState {
43 proxy,
44 _temp_dir: temp_dir,
45 }
46}
47
48#[tokio::test]
49async fn test_empty_config() {

Calls 2

pathMethod · 0.80
load_config_figmentFunction · 0.50

Tested by

no test coverage detected