()
| 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() { |
nothing calls this directly
no test coverage detected