Skip to content

Commit d0e85fa

Browse files
committed
gcp test
1 parent f4dbf3f commit d0e85fa

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/gcp/builder.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,8 @@ impl GoogleCloudStorageBuilder {
612612

613613
#[cfg(test)]
614614
mod tests {
615+
use crate::crypto;
616+
615617
use super::*;
616618
use std::collections::HashMap;
617619
use std::io::Write;
@@ -764,4 +766,22 @@ mod tests {
764766
panic!("{key} not propagated as ClientConfigKey");
765767
}
766768
}
769+
770+
#[test]
771+
fn gcp_test_crypto_configuration() {
772+
let builder = GoogleCloudStorageBuilder::default()
773+
.with_bucket_name("testbucket")
774+
.with_crypto(Arc::from(crypto::noop_crypto::NoopCrypto {}));
775+
776+
let bytes = b"hello world";
777+
assert_eq!(
778+
builder
779+
.crypto_provider
780+
.unwrap()
781+
.digest_sha256(bytes)
782+
.unwrap()
783+
.as_ref(),
784+
bytes
785+
);
786+
}
767787
}

0 commit comments

Comments
 (0)