forked from awsdocs/aws-doc-sdk-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Mock connector tests * Add single_shot macros for one-time request and response testing clients. * Use single_shot for iam tests * Moved mock connector macros to their own crate * Responding to feedback * Update without from_conf_conn * Bump deps versions * Use new credentials crate * Clippy * Editorial Co-authored-by: Steven Meyer <[email protected]>
- Loading branch information
1 parent
cb42132
commit c8e8df4
Showing
16 changed files
with
329 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ members = [ | |
"sqs", | ||
"ssm", | ||
"stepfunction", | ||
"test-utils", | ||
"testing", | ||
"tls", | ||
"transcribestreaming", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
rust_dev_preview/iam/testing/test_create_policy_response_malformed.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Error> | ||
<Code>MalformedPolicyDocument</Code> | ||
<Message>MalformedPolicyDocument</Message> | ||
<RequestId>ABC123EXAMPLE</RequestId> | ||
<HostId>RVhBTVBMRSBIT1NU</HostId> | ||
</Error> |
17 changes: 17 additions & 0 deletions
17
rust_dev_preview/iam/testing/test_create_policy_response_success.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<CreatePolicyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> | ||
<CreatePolicyResult> | ||
<Policy> | ||
<PolicyName>S3-read-only-example-bucket</PolicyName> | ||
<DefaultVersionId>v1</DefaultVersionId> | ||
<PolicyId>AGPACKCEVSQ6C2EXAMPLE</PolicyId> | ||
<Path>/</Path> | ||
<Arn>arn:aws:iam::123456789012:policy/S3-read-only-example-bucket</Arn> | ||
<AttachmentCount>0</AttachmentCount> | ||
<CreateDate>2014-09-15T17:36:14.673Z</CreateDate> | ||
<UpdateDate>2014-09-15T17:36:14.673Z</UpdateDate> | ||
</Policy> | ||
</CreatePolicyResult> | ||
<ResponseMetadata> | ||
<RequestId>ca64c9e1-3cfe-11e4-bfad-8d1c6EXAMPLE</RequestId> | ||
</ResponseMetadata> | ||
</CreatePolicyResponse> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "sdk-examples-test-utils" | ||
version = "0.1.0" | ||
authors = [ | ||
"David Souther <[email protected]>", | ||
] | ||
edition = "2021" | ||
|
||
[dependencies] | ||
aws-config = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" } | ||
aws-smithy-client = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next", features = [ | ||
"test-util", | ||
] } | ||
aws-smithy-http = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next" } | ||
aws-types = { git = "https://github.com/awslabs/aws-sdk-rust", branch = "next"} | ||
http = "0.2" | ||
|
||
[lib] | ||
path="src/mod.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Test Utilities for SDK for Rust code examples | ||
|
||
## Purpose | ||
|
||
These utilities help streamline common testing actions in the AWS SDK for Rust. | ||
|
||
## Code example | ||
|
||
- [Macros for creating mock connection request/response pairs](src/macros.rs) | ||
|
||
## ⚠ Important | ||
|
||
- We recommend that you grant this code least privilege, | ||
or at most the minimum permissions required to perform the task. | ||
For more information, see | ||
[Grant Least Privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege) | ||
in the AWS Identity and Access Management User Guide. | ||
- This code has not been tested in all AWS Regions. | ||
Some AWS services are available only in specific | ||
[Regions](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services). | ||
- Running this code might result in charges to your AWS account. | ||
|
||
## Running the code example | ||
|
||
The code in this example is not self-executing. Instead, look at its usage in | ||
the unit tests of other AWS SDK for Rust examples. | ||
|
||
## Resources | ||
|
||
- [AWS SDK for Rust repo](https://github.com/awslabs/aws-sdk-rust) | ||
- [AWS SDK for Rust Developer Guide](https://docs.aws.amazon.com/sdk-for-rust/latest/dg) | ||
|
||
## Contributing | ||
|
||
To propose a new code example to the AWS documentation team, | ||
see [CONTRIBUTING.md](https://github.com/awsdocs/aws-doc-sdk-examples/blob/master/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 |
Oops, something went wrong.