()
| 21 | } |
| 22 | |
| 23 | async 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] |
| 49 | async fn test_empty_config() { |
no test coverage detected