} pub(crate) fn get_json(&self, path: impl AsRef) -> T { if let Err(error) = self.index.update() { log::error!("{error}"); } let client = reqwest::blocking::Client::new(); let response = client .get(self.join_url(path.as_ref())) .header(reqwest::header::ACCEPT, "application/json") .send() .unwrap(); assert_eq!(response.status(), StatusCode::OK); response.json().unwrap() } fn join_url(&self, url: &str) -> Url { self.url.join(url).unwrap() } fn assert_response(&self, path: impl AsRef, status: StatusCode, expected_response: &str) { let response = self.get(path); assert_eq!(response.status(), status, "{}", response.text().unwrap()); pretty_assert_eq!(response.text().unwrap(), expected_response); } fn assert_response_regex( &self, path: impl AsRef, status: StatusCode, regex: impl AsRef, ) { let response = self.get(path);