use aur_rs::{Request, ReturnData}; use httpmock::prelude::*; mod common; #[tokio::test] async fn multi_search() { let kit = common::setup(); let search_mock = kit.mock_server.mock(|when, then| { when.method(GET).path("/rpc/v5/info"); then.status(200).body(kit.valid_multi_info_json.clone()); }); let url = kit.mock_server.url("/rpc/v5"); let request = Request { endpoint: url.to_string(), }; let response: ReturnData = request .search_multi_info_by_names(&["yay", "yay-bin"]) .await .unwrap(); search_mock.assert(); // TODO: Write more comprehensive tests. assert_eq!(response.results[0].name, "yay"); assert_eq!(response.results[1].name, "yay-bin"); }