Skip to content

Commit

Permalink
correcting doc-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aaravm committed Aug 12, 2024
1 parent 8ddb90b commit 7e18a63
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/src/tes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ mod tests {
return Err(e);
}
};
let file_path = "./tests/sample.tes".to_string();
let file_path = "../tests/sample.tes".to_string();
let task_json = std::fs::read_to_string(file_path).expect("Unable to read file");
let task: TesTask = serde_json::from_str(&task_json).expect("JSON was not well-formatted");

Expand Down
19 changes: 13 additions & 6 deletions lib/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,32 @@
/// # Examples
///
/// ```
/// use crate::configuration::Configuration;
/// use crate::transport::Transport;
/// use crate::ga4gh_sdk::configuration::Configuration;
/// use crate::ga4gh_sdk::transport::Transport;
///
/// let config = Configuration::new("Url::parse("https://api.example.com").unwrap() , None, None, None);
/// let config = Configuration::new(url::Url::parse("https://api.example.com").unwrap());
/// let transport = Transport::new(&config);
///
/// // Make a GET request
/// async {
/// let response = transport.get("/users", None).await;
/// };
///
/// // Make a POST request
/// let data = serde_json::json!({"name": "John Doe", "age": 30});
/// let response = transport.post("/users", Some(data)).await;
///
/// async {
/// let data = serde_json::json!({"name": "John Doe", "age": 30});
/// let response = transport.post("/users", Some(data)).await;
/// };
/// // Make a PUT request
/// async {
/// let data = serde_json::json!({"name": "John Doe", "age": 30});
/// let response = transport.put("/users/1", data).await;
/// };
///
/// // Make a DELETE request
/// async {
/// let response = transport.delete("/users/1").await;
/// };
/// ```
use crate::configuration::Configuration;
use log::error;
Expand Down

0 comments on commit 7e18a63

Please sign in to comment.