rustv1/examples/testing/README.md
These examples demonstrate how to create an integration test for an SDK for Rust operation. It uses the Amazon Simple Storage Service (Amazon S3) ListObjectsV2 operation to accumulate the size, in bytes, of objects in a bucket with a specified prefix, and shows how to mock the call using traits or an enum.
You must have an AWS account, and have configured your default credentials and AWS Region as described in https://github.com/awslabs/aws-sdk-rust.
This example gets the accumulated size, in bytes, of the objects with a specified prefix in a bucket.
cargo run -- -b BUCKET -p PREFIX [-r REGION] [-v]
There are four unit tests, two with the same name in enums.rs and two in traits.rs.
You can run all of the tests with the following command:
cargo test
To propose a new code example to the AWS documentation team, see CONTRIBUTING.md. The team prefers to create code examples that show broad scenarios rather than individual API calls.
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0