Skip to content

Commit 9ffff77

Browse files
committed
minor bug fixes
1 parent 6b4bf92 commit 9ffff77

File tree

4 files changed

+30
-11
lines changed

4 files changed

+30
-11
lines changed

Diff for: cli/src/main.rs

+14-2
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,26 @@ async fn main() -> Result<(), Box<dyn Error>> {
257257
Ok(())
258258
}
259259

260-
/// Example `config.json` file:
260+
/// Loads the configuration from a JSON file.
261+
///
262+
/// # Example `config.json`
261263
///
262264
/// ```json
263265
/// {
264266
/// "base_path": "http://localhost:8000",
265-
/// "user_agent": "username"
267+
/// "user_agent": "Some(User)",
268+
/// "basic_auth": {
269+
/// "username": "your_username",
270+
/// "password": "your_password"
271+
/// },
272+
/// "oauth_access_token": "your_oauth_access_token"
266273
/// }
267274
/// ```
275+
///
276+
/// # Errors
277+
///
278+
/// This function will return an error if the configuration file is missing or malformed.
279+
268280

269281
fn read_configuration_from_file(file_path: &str) -> Result<Configuration, Box<dyn Error>> {
270282
let mut file = File::open(file_path)?;

Diff for: lib/src/clients/tes/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
/// ```rust
7777
/// use ga4gh_sdk::clients::tes::TES;
7878
/// use ga4gh_sdk::utils::configuration::Configuration;
79-
/// use ga4gh_sdk::clients::tes::model::ListTasksParams;
79+
/// use ga4gh_sdk::clients::tes::models::ListTasksParams;
8080
///
8181
/// # async fn test_tes_list_tasks() -> Result<(), Box<dyn std::error::Error>> {
8282
/// let config = Configuration::new(url::Url::parse("http://example.com")?);

Diff for: lib/src/tes/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::tes::models::TesListTasksResponse;
77
use crate::tes::models::TesState;
88
use crate::tes::models::TesTask;
99
use crate::transport::Transport;
10-
use crate::tes::model::ListTasksParams;
10+
use crate::tes::models::ListTasksParams;
1111
use serde_json;
1212
use serde_json::from_str;
1313
use serde_json::json;

Diff for: lib/tests/funnel_tes.rs

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#[cfg(feature = "integration_tests")]
22
#[cfg(test)]
33
mod tests {
4-
use ga4gh_sdk::utils::configuration::Configuration;
4+
use ga4gh_sdk::clients::tes::models::ListTasksParams;
5+
use ga4gh_sdk::clients::tes::models::TesState;
56
use ga4gh_sdk::clients::tes::models::TesTask;
6-
use ga4gh_sdk::clients::tes::model::ListTasksParams;
77
use ga4gh_sdk::clients::tes::Task;
8-
use ga4gh_sdk::clients::tes::models::TesState;
98
use ga4gh_sdk::clients::tes::TES;
9+
use ga4gh_sdk::utils::configuration::Configuration;
1010
use ga4gh_sdk::utils::test_utils::{ensure_funnel_running, setup};
1111

1212
async fn create_task() -> Result<(Task, TES), Box<dyn std::error::Error>> {
@@ -26,8 +26,12 @@ mod tests {
2626
let task_json = match std::fs::read_to_string(&file_path) {
2727
Ok(content) => content,
2828
Err(e) => {
29-
let current_dir = std::env::current_dir().unwrap_or_else(|_| std::path::PathBuf::from("unknown directory"));
30-
panic!("Unable to read file in directory {:?}: {:?}", current_dir, e);
29+
let current_dir = std::env::current_dir()
30+
.unwrap_or_else(|_| std::path::PathBuf::from("unknown directory"));
31+
panic!(
32+
"Unable to read file in directory {:?}: {:?}",
33+
current_dir, e
34+
);
3135
}
3236
};
3337
let task: TesTask = serde_json::from_str(&task_json).expect("JSON was not well-formatted");
@@ -54,7 +58,10 @@ mod tests {
5458
match status {
5559
Ok(state) => {
5660
assert!(
57-
matches!(state, TesState::Initializing | TesState::Queued | TesState::Running),
61+
matches!(
62+
state,
63+
TesState::Initializing | TesState::Queued | TesState::Running
64+
),
5865
"Unexpected state: {:?}",
5966
state
6067
);
@@ -97,4 +104,4 @@ mod tests {
97104
assert!(list.is_ok());
98105
println!("{:?}", list);
99106
}
100-
}
107+
}

0 commit comments

Comments
 (0)