Skip to content

Commit

Permalink
Update api.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelvlach committed Jun 7, 2024
1 parent 72ef869 commit 6ac86b6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions agdb_api/rust/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,3 +500,22 @@ impl<T: HttpClient> AgdbApi<T> {
format!("{}{uri}", self.base_url)
}
}

#[cfg(feature = "reqwest")]
mod tests {
use super::*;

Check failure on line 506 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_api_rust_analyse

unused import: `super::*`

Check failure on line 506 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_api_rust_coverage

unused import: `super::*`

Check failure on line 506 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_api_typescript_coverage

unused import: `super::*`

Check failure on line 506 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_api_typescript_coverage

unused import: `super::*`

Check failure on line 506 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_server_analyse

unused import: `super::*`

Check failure on line 506 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_examples_analyse

unused import: `super::*`

Check failure on line 506 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_server_coverage

unused import: `super::*`

Check failure on line 506 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_examples_build

unused import: `super::*`

Check failure on line 506 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_server_test

unused import: `super::*`
use crate::ReqwestClient;

Check failure on line 507 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_api_rust_analyse

unused import: `crate::ReqwestClient`

Check failure on line 507 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_api_rust_coverage

unused import: `crate::ReqwestClient`

Check failure on line 507 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_api_typescript_coverage

unused import: `crate::ReqwestClient`

Check failure on line 507 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_api_typescript_coverage

unused import: `crate::ReqwestClient`

Check failure on line 507 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_server_analyse

unused import: `crate::ReqwestClient`

Check failure on line 507 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_examples_analyse

unused import: `crate::ReqwestClient`

Check failure on line 507 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_server_coverage

unused import: `crate::ReqwestClient`

Check failure on line 507 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_examples_build

unused import: `crate::ReqwestClient`

Check failure on line 507 in agdb_api/rust/src/api.rs

View workflow job for this annotation

GitHub Actions / agdb_server_test

unused import: `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");
}
}

0 comments on commit 6ac86b6

Please sign in to comment.