MCPcopy Create free account
hub / github.com/cargo-lambda/cargo-lambda / test_download_example

Function test_download_example

crates/cargo-lambda-invoke/src/lib.rs:354–374  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

352
353 #[tokio::test]
354 async fn test_download_example() {
355 let server = MockServer::start_async().await;
356
357 let mock = server.mock(|when, then| {
358 when.path("/example-apigw-request.json");
359 then.status(200)
360 .header("Content-Type", "application/json")
361 .body_from_file("../../tests/fixtures/events/example-apigw-request.json");
362 });
363
364 let data = download_example(
365 "example-apigw-request.json",
366 None,
367 Some(&format!("http://{}", server.address())),
368 )
369 .await
370 .expect("failed to download json");
371
372 mock.assert();
373 assert!(data.contains("\"path\": \"/hello/world\""));
374 }
375
376 #[tokio::test]
377 async fn test_download_example_with_cache() {

Callers

nothing calls this directly

Calls 2

download_exampleFunction · 0.85
pathMethod · 0.80

Tested by

no test coverage detected