diff --git a/agdb_api/rust/src/api.rs b/agdb_api/rust/src/api.rs index ac9591073..fd0b8a640 100644 --- a/agdb_api/rust/src/api.rs +++ b/agdb_api/rust/src/api.rs @@ -500,3 +500,22 @@ impl AgdbApi { format!("{}{uri}", self.base_url) } } + +#[cfg(feature = "reqwest")] +mod tests { + use super::*; + use crate::ReqwestClient; + + #[test] + fn address() { + let client = AgdbApi::new(ReqwestClient::new(), "http://localhost:3000"); + assert_eq!(client.address(), "http://localhost:3000"); + } + + #[test] + fn base_path() { + let client = AgdbApi::new(ReqwestClient::new(), "http://localhost:3000/public"); + assert_eq!(client.address(), "http://localhost:3000/public"); + assert_eq!(client.base_url(), "http://localhost:3000/public/api/v1"); + } +}