Skip to content

Commit eb404cf

Browse files
add object-store-aws test (#619)
small change to add object-store-aws test, also add example on how to use keys. --------- Co-authored-by: Pete Gadomski <pete.gadomski@gmail.com>
1 parent ee46d0a commit eb404cf

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

crates/core/src/format.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,14 @@ impl Format {
136136
/// # Examples
137137
///
138138
/// ```no_run
139-
/// use stac::{Item, Format};
139+
/// use stac::{Catalog, Format};
140140
///
141141
/// #[cfg(feature = "object-store-aws")]
142142
/// {
143143
/// # tokio_test::block_on(async {
144-
/// let item: Item = stac::io::get_opts("s3://bucket/item.json", [("aws_access_key_id", "...")]).await.unwrap();
144+
/// let catalog: Catalog = stac::io::get_opts("s3://nz-elevation/catalog.json",
145+
/// [("skip_signature", "true"), ("region", "ap-southeast-2")],
146+
/// ).await.unwrap();
145147
/// # })
146148
/// }
147149
/// ```

crates/core/tests/examples.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,16 @@ fn v1_1_0(#[files("../../spec-examples/v1.1.0/**/*.json")] path: PathBuf) {
1313
let value: Value = stac::read(path.to_str().unwrap()).unwrap();
1414
value.validate().unwrap();
1515
}
16+
17+
#[test]
18+
#[cfg(feature = "object-store-aws")]
19+
fn read_from_s3() {
20+
tokio_test::block_on(async {
21+
stac::io::get_opts::<stac::Catalog, _, _, _>(
22+
"s3://nz-elevation/catalog.json",
23+
[("skip_signature", "true"), ("region", "ap-southeast-2")],
24+
)
25+
.await
26+
.unwrap();
27+
});
28+
}

0 commit comments

Comments
 (0)