// Search by provides use aur_rs::{Request, ReturnData}; use httpmock::prelude::*; mod common; #[tokio::test] async fn search_package_by_provides() { let kit = common::setup(); let search_mock = kit.mock_server.mock(|when, then| { when.method(GET).path("/rpc/v5/search/yay"); then.status(200).body(kit.valid_provides_json.clone()); }); let url = kit.mock_server.url("/rpc/v5"); let request = Request { endpoint: url.to_string(), }; let response: ReturnData = request.search_package_by_provides("yay").await.unwrap(); search_mock.assert(); assert_eq!(response.results[0].name, "yay-bin"); assert_eq!(response.results[1].name, "yay-git"); assert_eq!(response.results[2].name, "yay"); }