Skip to content

Commit

Permalink
Merge pull request #8 from r3stl355/unit-tests
Browse files Browse the repository at this point in the history
add unit tests
  • Loading branch information
r3stl355 authored Jan 24, 2023
2 parents 1e49961 + 57e1c10 commit da4aee6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ wiremock = "0.5"
uuid = { version = "1.1", features = ["v4"] }
tokio-test = { version = "0.4" }
rand = "0.8.5"
test-case = "2.2.1"

[[example]]
name = "async"
Expand Down
18 changes: 18 additions & 0 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,21 @@ impl Client {
load_parquet_files_as_dataframe(&table_path)
}
}

#[cfg(test)]
mod tests {
use test_case::test_case;

#[test_case(1 ; "when version matches")]
#[test_case(crate::utils::CREDENTIALS_VERSION + 1 => panics ; "when version is greater")]
#[tokio::test]
async fn reject_newer_credentials_version(version: i32) {
let config = crate::protocol::ProviderConfig {
share_credentials_version: version,
endpoint: "https://sharing.delta.io/delta-sharing/".to_string(),
bearer_token: "token".to_string(),
};
let c = super::Client::new(config, None).await;
drop(c);
}
}

0 comments on commit da4aee6

Please sign in to comment.