Skip to content

Commit

Permalink
Merge s3_build_error and s3_success into one test (#3602)
Browse files Browse the repository at this point in the history
  • Loading branch information
Licht-T authored Sep 24, 2022
1 parent 0b204c6 commit 8bcc965
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions datafusion-cli/src/object_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,15 @@ mod tests {
}

#[test]
fn s3_build_error() {
fn s3_region_validation() {
let s3 = "s3://bucket_name/path";
let provider = DatafusionCliObjectStoreProvider {};
let err = provider
.get_by_url(&Url::from_str(s3).unwrap())
.unwrap_err();
assert!(err.to_string().contains("Generic S3 error: Missing region"));
}

#[test]
fn s3_success() {
let s3 = "s3://bucket_name/path";
env::set_var("AWS_DEFAULT_REGION", "us-east-1");
let provider = DatafusionCliObjectStoreProvider {};
assert!(provider.get_by_url(&Url::from_str(s3).unwrap()).is_ok());
env::remove_var("AWS_DEFAULT_REGION");
}
Expand Down

0 comments on commit 8bcc965

Please sign in to comment.