INNER CODE UNIT · Rust
repo_from_test_file
FeatureProbe/FeatureProbe · server/src/http/mod.rs:416
fn repo_from_test_file() -> Repository {
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
path.push("resources/fixtures/repo.json");
let json_str = fs::read_to_string(path).unwrap();
serde_json::from_str::<Repository>(&json_str).unwrap()
}
async fn setup_mock_api(port: u16) {
let mock_feature_probe_api = LocalFileHttpHandlerForTest::default();
tokio::spawn(crate::http::serve_http::<LocalFileHttpHandlerForTest>(
port,
mock_feature_probe_api,
));
tokio::time::sleep(Duration::from_millis(100)).await;
}
async fn setup_fp_server(
target_port: u16,