Skip to content

Commit

Permalink
add test_get_config
Browse files Browse the repository at this point in the history
  • Loading branch information
Omarabdul3ziz committed Oct 3, 2023
1 parent 80851b9 commit 2f45892
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/store/s3store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,15 @@ mod test {

#[test]
fn test_get_config() {
let (cred, region, bucket_name) = get_config("s3//minioadmin:[email protected]:9000/mybucket")?;
let (cred, region, bucket_name) = get_config("s3://minioadmin:[email protected]:9000/mybucket").unwrap();
assert_eq!(cred, Credentials {
access_key: Some("minioadmin".to_string()),
secret_key: Some("minioadmin".to_string()),
security_token: None,
session_token: None,
expiration: None,
});
assert_eq!(region, Region::Custom { region: REGION_NAME.to_string(), endpoint: "127.0.0.1:9000".to_string() });
assert_eq!(bucket_name, "mybucket".to_string())
}
}

0 comments on commit 2f45892

Please sign in to comment.