id stringlengths 22 133 | text stringlengths 40 40.2k | arch stringclasses 1
value | syntax stringclasses 1
value | kind stringclasses 4
values | repo stringclasses 27
values | path stringlengths 5 116 | license stringclasses 6
values | commit stringlengths 40 40 | source_host stringclasses 1
value | category stringclasses 16
values | source_url stringlengths 85 196 | line_start int64 1 4.28k | line_end int64 4 4.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
awslabs/aws-sdk-rust:sdk/dynamodb/tests/movies.rs:3 | fn add_item(table_name: impl Into<String>, item: Value) -> put_item_input::Builder {
let attribute_value = match value_to_item(item) {
AttributeValue::M(map) => map,
other => panic!("can only insert top level values, got {:?}", other),
};
PutItemInput::builder()
.table_name(table_na... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/movies.rs | Apache-2.0 | 0bd72113df4463a5e932a1f8bcdd402ba2d72fbb | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0bd72113df4463a5e932a1f8bcdd402ba2d72fbb/sdk/dynamodb/tests/movies.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/movies.rs:4 | other => return other,
};
match response {
Ok(SdkSuccess { parsed, .. }) => {
if parsed
.table
.as_ref()
.unwrap()
.table_status
.as_ref()
.unwrap()
... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/movies.rs | Apache-2.0 | 0bd72113df4463a5e932a1f8bcdd402ba2d72fbb | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0bd72113df4463a5e932a1f8bcdd402ba2d72fbb/sdk/dynamodb/tests/movies.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/movies.rs:5 | /// This is to account for some non-determinism in the Tokio timer
fn assert_time_passed(initial: Instant, passed: Duration) {
let now = tokio::time::Instant::now();
let delta = now - initial;
if (delta.as_millis() as i128 - passed.as_millis() as i128).abs() > 5 {
assert_eq!(delta, passed)
}
}
... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/movies.rs | Apache-2.0 | 0bd72113df4463a5e932a1f8bcdd402ba2d72fbb | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0bd72113df4463a5e932a1f8bcdd402ba2d72fbb/sdk/dynamodb/tests/movies.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/movies.rs:6 | let data = match serde_json::from_str(include_str!("data.json")).expect("should be valid JSON")
{
Value::Array(inner) => inner,
data => panic!("data must be an array, got: {:?}", data),
};
for item in data {
client
.call(add_item(table_name, item.clone()).build(&conf).exp... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/movies.rs | Apache-2.0 | 0bd72113df4463a5e932a1f8bcdd402ba2d72fbb | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0bd72113df4463a5e932a1f8bcdd402ba2d72fbb/sdk/dynamodb/tests/movies.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/movies.rs:7 | }
/// Test connection for the movies IT
/// headers are signed with actual creds, at some point we could replace them with verifiable test
/// credentials, but there are plenty of other tests that target signing
fn movies_it_test_connection() -> TestConnection<&'static str> {
TestConnection::new(vec![(
... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/movies.rs | Apache-2.0 | 0bd72113df4463a5e932a1f8bcdd402ba2d72fbb | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0bd72113df4463a5e932a1f8bcdd402ba2d72fbb/sdk/dynamodb/tests/movies.rs | 241 | 300 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/movies.rs:8 | .header("connection", "keep-alive")
.header("x-amzn-requestid", "O1C6QKCG8GT7D2K922T4QRL9N3VV4KQNSO5AEMVJF66Q9ASUAAJG")
.header("x-amz-crc32", "46742265")
.status(http::StatusCode::from_u16(200).unwrap())
... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/movies.rs | Apache-2.0 | 0bd72113df4463a5e932a1f8bcdd402ba2d72fbb | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0bd72113df4463a5e932a1f8bcdd402ba2d72fbb/sdk/dynamodb/tests/movies.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/movies.rs:9 | .status(http::StatusCode::from_u16(200).unwrap())
.body(r#"{"Table":{"AttributeDefinitions":[{"AttributeName":"title","AttributeType":"S"},{"AttributeName":"year","AttributeType":"N"}],"CreationDateTime":1.615218678973E9,"ItemCount":0,"KeySchema":[{"AttributeName":"year","KeyType":"HAS... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/movies.rs | Apache-2.0 | 0bd72113df4463a5e932a1f8bcdd402ba2d72fbb | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0bd72113df4463a5e932a1f8bcdd402ba2d72fbb/sdk/dynamodb/tests/movies.rs | 321 | 380 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/movies.rs:10 | (http::Request::builder()
.header("content-type", "application/x-amz-json-1.0")
.header("x-amz-target", "DynamoDB_20120810.PutItem")
.header("content-length", "619")
.header("host", "d... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/movies.rs | Apache-2.0 | 0bd72113df4463a5e932a1f8bcdd402ba2d72fbb | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0bd72113df4463a5e932a1f8bcdd402ba2d72fbb/sdk/dynamodb/tests/movies.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/movies.rs:11 | .header("x-amz-target", "DynamoDB_20120810.Query")
.header("content-length", "156")
.header("host", "dynamodb.us-east-1.amazonaws.com")
.header("authorization", "AWS4-HMAC-SHA256 Credential=ASIAR6OFQKMAFQIIYZ5T/2021030... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/movies.rs | Apache-2.0 | 0bd72113df4463a5e932a1f8bcdd402ba2d72fbb | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0bd72113df4463a5e932a1f8bcdd402ba2d72fbb/sdk/dynamodb/tests/movies.rs | 401 | 438 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use std::collections::HashMap;
use std::iter::FromIterator;
use aws_credential_types::Credentials;
use aws_sdk_dynamodb::types::AttributeValue;
use aws_sdk_dynamodb::{Client, Config};
use aws_smithy_htt... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/paginators.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:2 | body,
r#"{"TableName":"test-table","Limit":32}"#,
MediaType::Json,
));
}
fn mk_request(body: &'static str) -> http_1x::Request<SdkBody> {
http_1x::Request::builder()
.uri("https://dynamodb.us-east-1.amazonaws.com/")
.body(SdkBody::from(body))
.unwrap()
}
fn mk_response(... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/paginators.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:3 | r#"{"TableName":"test-table","Limit":32,"ExclusiveStartKey":{"PostedBy":{"S":"joe@example.com"}}}"#,
),
mk_response(
r#"{
"Count": 1,
"Items": [{
"PostedBy": {
... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/paginators.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:4 | assert_eq!(
second_page.items.unwrap_or_default(),
vec![HashMap::from_iter([(
"PostedBy".to_string(),
AttributeValue::S("jack@example.com".to_string())
)])]
);
assert_eq!(http_client.actual_requests().count(), 2);
assert!(
paginator.next().await.is_non... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/paginators.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:5 | .into_paginator()
.page_size(32)
.items()
.send();
assert_eq!(
rows.try_next()
.await
.expect("no error")
.expect("not EOS")
.get("PostedBy"),
Some(&AttributeValue::S("joe@example.com".to_string()))
);
rows.try_next().aw... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/paginators.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:6 | ),
]);
let client = Client::from_conf(stub_config(http_client.clone()));
let mut rows = client
.scan()
.table_name("test-table")
.into_paginator()
.page_size(32)
.items()
.send();
assert_eq!(
rows.try_next()
.await
.expect("... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/paginators.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:7 | }
}"#;
// send the same response twice with the same pagination token
let http_client = StaticReplayClient::new(vec![
ReplayEvent::new(
mk_request(r#"{"TableName":"test-table","Limit":32}"#),
mk_response(response),
),
ReplayEvent::new(
mk_request(
... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/paginators.rs | 241 | 295 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:8 | .await
.expect("no error")
.expect("not EOS")
.get("PostedBy"),
Some(&AttributeValue::S("joe@example.com".to_string()))
);
assert_eq!(
rows.try_next()
.await
.expect("no error")
.expect("not EOS")
.get("PostedBy"... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/paginators.rs | 281 | 295 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use std::collections::HashMap;
use std::iter::FromIterator;
use aws_credential_types::Credentials;
use aws_sdk_dynamodb::types::AttributeValue;
use aws_sdk_dynamodb::{Client, Config};
use aws_smithy_pro... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 882646f33ed8ca91a1541be0bcbd390545f04a99 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/882646f33ed8ca91a1541be0bcbd390545f04a99/sdk/dynamodb/tests/paginators.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:2 | let body = request.body().bytes().expect("data is loaded");
assert_ok(validate_body(
body,
r#"{"TableName":"test-table","Limit":32}"#,
MediaType::Json,
));
}
fn mk_request(body: &'static str) -> http::Request<SdkBody> {
http::Request::builder()
.uri("https://dynamodb.us-east... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 882646f33ed8ca91a1541be0bcbd390545f04a99 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/882646f33ed8ca91a1541be0bcbd390545f04a99/sdk/dynamodb/tests/paginators.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use std::collections::HashMap;
use std::iter::FromIterator;
use aws_credential_types::Credentials;
use aws_sdk_dynamodb::types::AttributeValue;
use aws_sdk_dynamodb::{Client, Config};
use aws_smithy_htt... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 55aa7275a4a080ca6c3b74b77d5f86d37dbb7720 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/55aa7275a4a080ca6c3b74b77d5f86d37dbb7720/sdk/dynamodb/tests/paginators.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use std::collections::HashMap;
use std::iter::FromIterator;
use tokio_stream::StreamExt;
use aws_credential_types::Credentials;
use aws_sdk_dynamodb::types::AttributeValue;
use aws_sdk_dynamodb::{Clien... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 52ab27a0991e627156812551ae09de47c168b423 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/52ab27a0991e627156812551ae09de47c168b423/sdk/dynamodb/tests/paginators.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:2 | let body = request.body().bytes().expect("data is loaded");
assert_ok(validate_body(
body,
r#"{"TableName":"test-table","Limit":32}"#,
MediaType::Json,
));
}
fn mk_request(body: &'static str) -> http::Request<SdkBody> {
http::Request::builder()
.uri("https://dynamodb.us-east... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 52ab27a0991e627156812551ae09de47c168b423 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/52ab27a0991e627156812551ae09de47c168b423/sdk/dynamodb/tests/paginators.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:3 | r#"{"TableName":"test-table","Limit":32,"ExclusiveStartKey":{"PostedBy":{"S":"joe@example.com"}}}"#,
),
mk_response(
r#"{
"Count": 1,
"Items": [{
"PostedBy": {
... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 52ab27a0991e627156812551ae09de47c168b423 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/52ab27a0991e627156812551ae09de47c168b423/sdk/dynamodb/tests/paginators.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:4 | assert_eq!(
second_page.items.unwrap_or_default(),
vec![HashMap::from_iter([(
"PostedBy".to_string(),
AttributeValue::S("jack@example.com".to_string())
)])]
);
assert_eq!(conn.requests().len(), 2);
assert!(
paginator.next().await.is_none(),
"no... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 52ab27a0991e627156812551ae09de47c168b423 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/52ab27a0991e627156812551ae09de47c168b423/sdk/dynamodb/tests/paginators.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:5 | .into_paginator()
.page_size(32)
.items()
.send();
assert_eq!(
rows.try_next()
.await
.expect("no error")
.expect("not EOS")
.get("PostedBy"),
Some(&AttributeValue::S("joe@example.com".to_string()))
);
rows.try_next().aw... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 52ab27a0991e627156812551ae09de47c168b423 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/52ab27a0991e627156812551ae09de47c168b423/sdk/dynamodb/tests/paginators.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:6 | ),
]);
let client = Client::from_conf(stub_config(conn.clone()));
let mut rows = client
.scan()
.table_name("test-table")
.into_paginator()
.page_size(32)
.items()
.send();
assert_eq!(
rows.try_next()
.await
.expect("no erro... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 52ab27a0991e627156812551ae09de47c168b423 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/52ab27a0991e627156812551ae09de47c168b423/sdk/dynamodb/tests/paginators.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:7 | }
}"#;
// send the same response twice with the same pagination token
let conn = TestConnection::new(vec![
(
mk_request(r#"{"TableName":"test-table","Limit":32}"#),
mk_response(response),
),
(
mk_request(
r#"{"TableName":"test-table... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 52ab27a0991e627156812551ae09de47c168b423 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/52ab27a0991e627156812551ae09de47c168b423/sdk/dynamodb/tests/paginators.rs | 241 | 295 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use std::collections::HashMap;
use std::iter::FromIterator;
use tokio_stream::StreamExt;
use aws_credential_types::Credentials;
use aws_sdk_dynamodb::model::AttributeValue;
use aws_sdk_dynamodb::{Clien... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 15b6f9e6b678dae29f37fe78a4df142a3cfe7607 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/15b6f9e6b678dae29f37fe78a4df142a3cfe7607/sdk/dynamodb/tests/paginators.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use std::collections::HashMap;
use std::iter::FromIterator;
use tokio_stream::StreamExt;
use aws_credential_types::Credentials;
use aws_sdk_dynamodb::model::AttributeValue;
use aws_sdk_dynamodb::{Clien... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 252473172ce9bd8b1c0e280cc125530ffc212c44 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/252473172ce9bd8b1c0e280cc125530ffc212c44/sdk/dynamodb/tests/paginators.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use std::collections::HashMap;
use std::iter::FromIterator;
use tokio_stream::StreamExt;
use aws_sdk_dynamodb::model::AttributeValue;
use aws_sdk_dynamodb::{Client, Config};
use aws_smithy_client::http... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 77a600931b61b1989b46c163297f41975cd65db6 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/77a600931b61b1989b46c163297f41975cd65db6/sdk/dynamodb/tests/paginators.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::model::AttributeValue;
use aws_sdk_dynamodb::{Client, Config};
use aws_smithy_client::test_connection::{capture_request, TestConnection};
use aws_smithy_http::body::SdkBody;
use aws... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | da0c8d0e822430972f9bc5a039e99c57017d9a4a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/da0c8d0e822430972f9bc5a039e99c57017d9a4a/sdk/dynamodb/tests/paginators.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:2 | MediaType::Json,
));
}
fn mk_request(body: &'static str) -> http::Request<SdkBody> {
http::Request::builder()
.uri("https://dynamodb.us-east-1.amazonaws.com/")
.body(SdkBody::from(body))
.unwrap()
}
fn mk_response(body: &'static str) -> http::Response<SdkBody> {
http::Response::bui... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | da0c8d0e822430972f9bc5a039e99c57017d9a4a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/da0c8d0e822430972f9bc5a039e99c57017d9a4a/sdk/dynamodb/tests/paginators.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:3 | "Count": 1,
"Items": [{
"PostedBy": {
"S": "jack@example.com"
}
}]
}"#,
),
),
]);
let client = Client::from_conf... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | da0c8d0e822430972f9bc5a039e99c57017d9a4a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/da0c8d0e822430972f9bc5a039e99c57017d9a4a/sdk/dynamodb/tests/paginators.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:4 | AttributeValue::S("jack@example.com".to_string())
)])]
);
assert_eq!(conn.requests().len(), 2);
assert!(
paginator.next().await.is_none(),
"no more pages should exist"
);
// we shouldn't make another request, we know we're at the end
assert_eq!(conn.requests().len(), 2);
... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | da0c8d0e822430972f9bc5a039e99c57017d9a4a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/da0c8d0e822430972f9bc5a039e99c57017d9a4a/sdk/dynamodb/tests/paginators.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:5 | assert_eq!(
rows.try_next()
.await
.expect("no error")
.expect("not EOS")
.get("PostedBy"),
Some(&AttributeValue::S("joe@example.com".to_string()))
);
rows.try_next().await.expect_err("failure");
assert_eq!(rows.try_next().await.expect("ok"), N... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | da0c8d0e822430972f9bc5a039e99c57017d9a4a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/da0c8d0e822430972f9bc5a039e99c57017d9a4a/sdk/dynamodb/tests/paginators.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:6 | .scan()
.table_name("test-table")
.into_paginator()
.page_size(32)
.items()
.send();
assert_eq!(
rows.try_next()
.await
.expect("no error")
.expect("not EOS")
.get("PostedBy"),
Some(&AttributeValue::S("joe@exampl... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | da0c8d0e822430972f9bc5a039e99c57017d9a4a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/da0c8d0e822430972f9bc5a039e99c57017d9a4a/sdk/dynamodb/tests/paginators.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:7 | (
mk_request(r#"{"TableName":"test-table","Limit":32}"#),
mk_response(response),
),
(
mk_request(
r#"{"TableName":"test-table","Limit":32,"ExclusiveStartKey":{"PostedBy":{"S":"joe@example.com"}}}"#,
),
mk_response(response),
... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | da0c8d0e822430972f9bc5a039e99c57017d9a4a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/da0c8d0e822430972f9bc5a039e99c57017d9a4a/sdk/dynamodb/tests/paginators.rs | 241 | 291 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:8 | Some(&AttributeValue::S("joe@example.com".to_string()))
);
assert_eq!(
rows.try_next()
.await
.expect("no error")
.expect("not EOS")
.get("PostedBy"),
Some(&AttributeValue::S("joe@example.com".to_string()))
);
} | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | da0c8d0e822430972f9bc5a039e99c57017d9a4a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/da0c8d0e822430972f9bc5a039e99c57017d9a4a/sdk/dynamodb/tests/paginators.rs | 281 | 291 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:4 | AttributeValue::S("jack@example.com".to_string())
)])]
);
assert_eq!(conn.requests().len(), 2);
assert!(
paginator.next().await.is_none(),
"no more pages should exist"
);
// we shouldn't make another request, we know we're at the end
assert_eq!(conn.requests().len(), 2);
... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 8159cb8ff570e4dca718e354c31cecdfadfeb0b8 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/dynamodb/tests/paginators.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:5 | assert_eq!(
rows.try_next()
.await
.expect("no error")
.expect("not EOS")
.get("PostedBy"),
Some(&AttributeValue::S("joe@example.com".to_string()))
);
rows.try_next().await.expect_err("failure");
assert_eq!(rows.try_next().await.expect("ok"), N... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 8159cb8ff570e4dca718e354c31cecdfadfeb0b8 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/dynamodb/tests/paginators.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:6 | .scan()
.table_name("test-table")
.into_paginator()
.page_size(32)
.items()
.send();
assert_eq!(
rows.try_next()
.await
.expect("no error")
.expect("not EOS")
.get("PostedBy"),
Some(&AttributeValue::S("joe@exampl... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 8159cb8ff570e4dca718e354c31cecdfadfeb0b8 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/dynamodb/tests/paginators.rs | 201 | 222 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use aws_sdk_dynamodb::model::AttributeValue;
use aws_sdk_dynamodb::{Client, Config};
use aws_smithy_client::test_connection::{capture_request, TestConnection};
use aws_smithy_http::body::SdkBody;
use aw... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | f2b4361b004ee822960ea9791f566fd4eb6d1aba | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/f2b4361b004ee822960ea9791f566fd4eb6d1aba/sdk/dynamodb/tests/paginators.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use aws_sdk_dynamodb::model::AttributeValue;
use aws_sdk_dynamodb::{Client, Config};
use aws_smithy_client::test_connection::{capture_request, TestConnection};
use aws_smithy_http::body::SdkBody;
use aw... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 3d3e1225e59755683893b72ab74bb68a5a853c8d | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3d3e1225e59755683893b72ab74bb68a5a853c8d/sdk/dynamodb/tests/paginators.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:2 | MediaType::Json,
));
}
fn mk_request(body: &'static str) -> http::Request<SdkBody> {
http::Request::builder()
.uri("https://dynamodb.us-east-1.amazonaws.com/")
.body(SdkBody::from(body))
.unwrap()
}
fn mk_response(body: &'static str) -> http::Response<SdkBody> {
http::Response::bui... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 3d3e1225e59755683893b72ab74bb68a5a853c8d | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3d3e1225e59755683893b72ab74bb68a5a853c8d/sdk/dynamodb/tests/paginators.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:4 | AttributeValue::S("jack@example.com".to_string())
)])]
);
assert_eq!(conn.requests().len(), 2);
assert!(
paginator.next().await.is_none(),
"no more pages should exist"
);
// we shouldn't make another request, we know we're at the end
assert_eq!(conn.requests().len(), 2);
... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 3d3e1225e59755683893b72ab74bb68a5a853c8d | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3d3e1225e59755683893b72ab74bb68a5a853c8d/sdk/dynamodb/tests/paginators.rs | 121 | 171 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/paginators.rs:5 | assert_eq!(
rows.try_next()
.await
.expect("no error")
.expect("not EOS")
.get("PostedBy"),
Some(&AttributeValue::S("joe@example.com".to_string()))
);
rows.try_next().await.expect_err("failure");
assert_eq!(rows.try_next().await.expect("ok"), N... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/paginators.rs | Apache-2.0 | 3d3e1225e59755683893b72ab74bb68a5a853c8d | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3d3e1225e59755683893b72ab74bb68a5a853c8d/sdk/dynamodb/tests/paginators.rs | 161 | 171 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::config::{
Credentials, Region, SharedAsyncSleep, StalledStreamProtectionConfig,
};
use aws_sdk_dynamodb::{config::retry::RetryConfig, error::ProvideErrorMetadata};
use aws_smith... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:2 | }
fn throttling_err() -> http_1x::Response<SdkBody> {
http_1x::Response::builder()
.status(400)
.body(SdkBody::from("{ \"message\": \"The request was denied due to request throttling.\", \"code\": \"ThrottlingException\" }"))
.unwrap()
}
#[tokio::test]
async fn test_adaptive_retries_with_n... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:3 | .retry_partition(RetryPartition::new(
"test_adaptive_retries_with_no_throttling_errors",
))
.http_client(http_client.clone())
.build();
let expected_table_names = vec!["Test".to_owned()];
// We create a new client each time to ensure that the cross-client retry state is work... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:4 | ReplayEvent::new(req(), err()),
ReplayEvent::new(req(), ok()),
];
let http_client = StaticReplayClient::new(events);
let config = aws_sdk_dynamodb::Config::builder()
.stalled_stream_protection(StalledStreamProtectionConfig::disabled())
.credentials_provider(Credentials::for_tests())... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 121 | 159 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::config::{
Credentials, Region, SharedAsyncSleep, StalledStreamProtectionConfig,
};
use aws_sdk_dynamodb::{config::retry::RetryConfig, error::ProvideErrorMetadata};
use aws_smith... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 93dcd5662ed321034af8538c4fcf8e41ccc5e951 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/93dcd5662ed321034af8538c4fcf8e41ccc5e951/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:2 | }
fn throttling_err() -> http::Response<SdkBody> {
http::Response::builder()
.status(400)
.body(SdkBody::from("{ \"message\": \"The request was denied due to request throttling.\", \"code\": \"ThrottlingException\" }"))
.unwrap()
}
#[tokio::test]
async fn test_adaptive_retries_with_no_thro... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 93dcd5662ed321034af8538c4fcf8e41ccc5e951 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/93dcd5662ed321034af8538c4fcf8e41ccc5e951/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::config::{
Credentials, Region, SharedAsyncSleep, StalledStreamProtectionConfig,
};
use aws_sdk_dynamodb::{config::retry::RetryConfig, error::ProvideErrorMetadata};
use aws_smith... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 5370d2af59d5b60d5683509317096554e3afbeef | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5370d2af59d5b60d5683509317096554e3afbeef/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:2 | fn throttling_err() -> http::Response<SdkBody> {
http::Response::builder()
.status(400)
.body(SdkBody::from("{ \"message\": \"The request was denied due to request throttling.\", \"code\": \"ThrottlingException\" }"))
.unwrap()
}
#[tokio::test]
async fn test_adaptive_retries_with_no_throttl... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 5370d2af59d5b60d5683509317096554e3afbeef | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5370d2af59d5b60d5683509317096554e3afbeef/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:3 | "test_adaptive_retries_with_no_throttling_errors",
))
.http_client(http_client.clone())
.build();
let expected_table_names = vec!["Test".to_owned()];
// We create a new client each time to ensure that the cross-client retry state is working.
let client = aws_sdk_dynamodb::Client::fr... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 5370d2af59d5b60d5683509317096554e3afbeef | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5370d2af59d5b60d5683509317096554e3afbeef/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:4 | ReplayEvent::new(req(), ok()),
];
let http_client = StaticReplayClient::new(events);
let config = aws_sdk_dynamodb::Config::builder()
.stalled_stream_protection(StalledStreamProtectionConfig::disabled())
.credentials_provider(Credentials::for_tests())
.region(Region::new("us-east-1"... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 5370d2af59d5b60d5683509317096554e3afbeef | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5370d2af59d5b60d5683509317096554e3afbeef/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 121 | 158 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::config::{Credentials, Region, SharedAsyncSleep};
use aws_sdk_dynamodb::{config::retry::RetryConfig, error::ProvideErrorMetadata};
use aws_smithy_async::test_util::instant_time_and_s... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 0656e34f774e36546f5348cd2abf9a3a17ea80ef | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0656e34f774e36546f5348cd2abf9a3a17ea80ef/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:2 | http::Response::builder()
.status(400)
.body(SdkBody::from("{ \"message\": \"The request was denied due to request throttling.\", \"code\": \"ThrottlingException\" }"))
.unwrap()
}
#[tokio::test]
async fn test_adaptive_retries_with_no_throttling_errors() {
let (time_source, sleep_impl) = in... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 0656e34f774e36546f5348cd2abf9a3a17ea80ef | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0656e34f774e36546f5348cd2abf9a3a17ea80ef/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:3 | .build();
let expected_table_names = vec!["Test".to_owned()];
// We create a new client each time to ensure that the cross-client retry state is working.
let client = aws_sdk_dynamodb::Client::from_conf(config.clone());
let res = client.list_tables().send().await.unwrap();
assert_eq!(sleep_impl.tot... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 0656e34f774e36546f5348cd2abf9a3a17ea80ef | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0656e34f774e36546f5348cd2abf9a3a17ea80ef/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:4 | let http_client = StaticReplayClient::new(events);
let config = aws_sdk_dynamodb::Config::builder()
.credentials_provider(Credentials::for_tests())
.region(Region::new("us-east-1"))
.retry_config(
RetryConfig::adaptive()
.with_max_attempts(4)
.with... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 0656e34f774e36546f5348cd2abf9a3a17ea80ef | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0656e34f774e36546f5348cd2abf9a3a17ea80ef/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 121 | 154 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::config::{Credentials, Region, SharedAsyncSleep};
use aws_sdk_dynamodb::{config::retry::RetryConfig, error::ProvideErrorMetadata};
use aws_smithy_async::test_util::instant_time_and_s... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 882646f33ed8ca91a1541be0bcbd390545f04a99 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/882646f33ed8ca91a1541be0bcbd390545f04a99/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:2 | fn throttling_err() -> HttpResponse {
http::Response::builder()
.status(400)
.body(SdkBody::from("{ \"message\": \"The request was denied due to request throttling.\", \"code\": \"ThrottlingException\" }"))
.unwrap()
}
#[tokio::test]
async fn test_adaptive_retries_with_no_throttling_errors(... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 882646f33ed8ca91a1541be0bcbd390545f04a99 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/882646f33ed8ca91a1541be0bcbd390545f04a99/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:3 | .http_client(http_client.clone())
.build();
let expected_table_names = vec!["Test".to_owned()];
// We create a new client each time to ensure that the cross-client retry state is working.
let client = aws_sdk_dynamodb::Client::from_conf(config.clone());
let res = client.list_tables().send().awa... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 882646f33ed8ca91a1541be0bcbd390545f04a99 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/882646f33ed8ca91a1541be0bcbd390545f04a99/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::config::{Credentials, Region, SharedAsyncSleep};
use aws_sdk_dynamodb::{config::retry::RetryConfig, error::ProvideErrorMetadata};
use aws_smithy_async::test_util::instant_time_and_s... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 280e400ab518efd8db7992921dc5345d9d67dac5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/280e400ab518efd8db7992921dc5345d9d67dac5/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::config::{Credentials, Region, SharedAsyncSleep};
use aws_sdk_dynamodb::{config::retry::RetryConfig, error::ProvideErrorMetadata};
use aws_smithy_async::test_util::instant_time_and_s... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 55aa7275a4a080ca6c3b74b77d5f86d37dbb7720 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/55aa7275a4a080ca6c3b74b77d5f86d37dbb7720/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#[cfg(not(aws_sdk_middleware_mode))]
mod test {
use aws_sdk_dynamodb::config::{Credentials, Region, SharedAsyncSleep};
use aws_sdk_dynamodb::{config::retry::RetryConfig, error::ProvideErrorMetada... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 35d96ea15378750dd69bdccc39406b9e45f24cd8 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/35d96ea15378750dd69bdccc39406b9e45f24cd8/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:2 | }
fn throttling_err() -> HttpResponse {
http::Response::builder()
.status(400)
.body(SdkBody::from("{ \"message\": \"The request was denied due to request throttling.\", \"code\": \"ThrottlingException\" }"))
.unwrap()
}
#[tokio::test]
async fn test_adaptive... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 35d96ea15378750dd69bdccc39406b9e45f24cd8 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/35d96ea15378750dd69bdccc39406b9e45f24cd8/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:3 | "test_adaptive_retries_with_no_throttling_errors",
))
.http_connector(conn.clone())
.build();
let expected_table_names = vec!["Test".to_owned()];
// We create a new client each time to ensure that the cross-client retry state is working.
let client = aws_sdk_... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 35d96ea15378750dd69bdccc39406b9e45f24cd8 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/35d96ea15378750dd69bdccc39406b9e45f24cd8/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:4 | (req(), ok()),
];
let conn = TestConnection::new(events);
let config = aws_sdk_dynamodb::Config::builder()
.credentials_provider(Credentials::for_tests())
.region(Region::new("us-east-1"))
.retry_config(
RetryConfig::adaptive()
... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 35d96ea15378750dd69bdccc39406b9e45f24cd8 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/35d96ea15378750dd69bdccc39406b9e45f24cd8/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 121 | 158 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#[cfg(aws_sdk_orchestrator_mode)]
mod test {
use aws_sdk_dynamodb::config::{Credentials, Region, SharedAsyncSleep};
use aws_sdk_dynamodb::{config::retry::RetryConfig, error::ProvideErrorMetadata}... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 0c75242eb1a5ffaac25659e2419f1cbdff559d89 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0c75242eb1a5ffaac25659e2419f1cbdff559d89/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#[cfg(aws_sdk_orchestrator_mode)]
mod test {
use aws_sdk_dynamodb::config::{Credentials, Region, SharedAsyncSleep};
use aws_sdk_dynamodb::{config::retry::RetryConfig, error::ProvideErrorMetadata}... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:2 | .status(500)
.body(SdkBody::from("{ \"message\": \"The request has failed because of an unknown error, exception or failure.\", \"code\": \"InternalServerError\" }"))
.unwrap()
}
fn throttling_err() -> HttpResponse {
http::Response::builder()
.status(400)
... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:3 | .time_source(SharedTimeSource::new(time_source))
.sleep_impl(SharedAsyncSleep::new(sleep_impl.clone()))
.retry_partition(RetryPartition::new(
"test_adaptive_retries_with_no_throttling_errors",
))
.http_connector(conn.clone())
.build();
... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:4 | (req(), err()),
(req(), throttling_err()),
(req(), ok()),
];
let conn = TestConnection::new(events);
let config = aws_sdk_dynamodb::Config::builder()
.credentials_provider(Credentials::for_tests())
.region(Region::new("us-east-1"))
.re... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 121 | 173 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/retries-with-client-rate-limiting.rs:5 | assert_eq!(err.to_string(), "request has timed out".to_owned());
// two requests should have been made, both failing (plus previous requests)
assert_eq!(conn.requests().len(), 2 + 2);
let since = start.elapsed();
// At least 300 milliseconds must pass:
// - 50ms for the first re... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/dynamodb/tests/retries-with-client-rate-limiting.rs | 161 | 173 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::config::{Credentials, Region, StalledStreamProtectionConfig};
use aws_smithy_http_client::test_util::capture_request;
use http_1x::Uri;
/// Iterative test of loading clients from s... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/shared-config.rs | 1 | 29 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::config::{Credentials, Region, StalledStreamProtectionConfig};
use aws_smithy_runtime::client::http::test_util::capture_request;
use http::Uri;
/// Iterative test of loading clients... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | 24f061306185efbb78fdd3f23e0bbd169ad28787 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/24f061306185efbb78fdd3f23e0bbd169ad28787/sdk/dynamodb/tests/shared-config.rs | 1 | 29 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_runtime::env_config::file::{EnvConfigFileKind, EnvConfigFiles};
use aws_sdk_dynamodb::config::{
BehaviorVersion, Credentials, Region, StalledStreamProtectionConfig,
};
use aws_smithy_runtime:... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/dynamodb/tests/shared-config.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:2 | env::remove_var("AWS_REGION");
let config = r#"
[profile custom]
aws_access_key_id = test-access-key-id
aws_secret_access_key = test-secret-access-key
aws_session_token = test-session-token
region = us-east-1
services = custom
[services custom]
dynamodb =
region = us-west-1
"#
.trim();
let shared_confi... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/dynamodb/tests/shared-config.rs | 41 | 73 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_runtime::env_config::file::{EnvConfigFileKind, EnvConfigFiles};
use aws_sdk_dynamodb::config::{
BehaviorVersion, Credentials, Region, StalledStreamProtectionConfig,
};
use aws_smithy_runtime:... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | b996b061857b5d1ebbdddcf5d078cbbef6d10e15 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b996b061857b5d1ebbdddcf5d078cbbef6d10e15/sdk/dynamodb/tests/shared-config.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:2 | aws_secret_access_key = test-secret-access-key
aws_session_token = test-session-token
region = us-east-1
services = custom
[services custom]
dynamodb =
region = us-west-1
"#
.trim();
let shared_config = aws_config::ConfigLoader::default()
.behavior_version(BehaviorVersion::latest())
.profile... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | b996b061857b5d1ebbdddcf5d078cbbef6d10e15 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b996b061857b5d1ebbdddcf5d078cbbef6d10e15/sdk/dynamodb/tests/shared-config.rs | 41 | 68 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::config::{Credentials, Region};
use aws_smithy_runtime::client::http::test_util::capture_request;
use http::Uri;
/// Iterative test of loading clients from shared configuration
#[to... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | 55aa7275a4a080ca6c3b74b77d5f86d37dbb7720 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/55aa7275a4a080ca6c3b74b77d5f86d37dbb7720/sdk/dynamodb/tests/shared-config.rs | 1 | 28 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::config::{Credentials, Region};
use http::Uri;
/// Iterative test of loading clients from shared configuration
#[tokio::test]
async fn shared_config_testbed() {
let shared_confi... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | 52ab27a0991e627156812551ae09de47c168b423 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/52ab27a0991e627156812551ae09de47c168b423/sdk/dynamodb/tests/shared-config.rs | 1 | 27 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::{Credentials, Region};
use http::Uri;
/// Iterative test of loading clients from shared configuration
#[tokio::test]
async fn shared_config_testbed() {
let shared_config = aws_... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | 15b6f9e6b678dae29f37fe78a4df142a3cfe7607 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/15b6f9e6b678dae29f37fe78a4df142a3cfe7607/sdk/dynamodb/tests/shared-config.rs | 1 | 27 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::{Credentials, Region};
use http::Uri;
/// Iterative test of loading clients from shared configuration
#[tokio::test]
async fn shared_config_testbed() {
let shared_config = aws_... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | 834045485b7f89be188d4b2b4592163f02defdc5 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/834045485b7f89be188d4b2b4592163f02defdc5/sdk/dynamodb/tests/shared-config.rs | 1 | 27 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::{Credentials, Region};
use http::Uri;
/// Iterative test of loading clients from shared configuration
#[tokio::test]
async fn shared_config_testbed() {
let shared_config = aws_... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | 77a600931b61b1989b46c163297f41975cd65db6 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/77a600931b61b1989b46c163297f41975cd65db6/sdk/dynamodb/tests/shared-config.rs | 1 | 26 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use aws_sdk_dynamodb::{Credentials, Region};
use http::Uri;
/// Iterative test of loading clients from shared configuration
#[tokio::test]
async fn shared_config_testbed() {
let shared_config = aws_... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | 8159cb8ff570e4dca718e354c31cecdfadfeb0b8 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/8159cb8ff570e4dca718e354c31cecdfadfeb0b8/sdk/dynamodb/tests/shared-config.rs | 1 | 25 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use aws_sdk_dynamodb::{Credentials, Region};
use http::Uri;
/// Iterative test of loading clients from shared configuration
#[tokio::test]
async fn shared_config_testbed() {
let shared_config = aws... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | 9134e4c2d6ae2bd5a73cf3bd04b4516a19d4143f | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9134e4c2d6ae2bd5a73cf3bd04b4516a19d4143f/sdk/dynamodb/tests/shared-config.rs | 1 | 25 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use aws_sdk_dynamodb::{Credentials, Region};
use http::Uri;
/// Iterative test of loading clients from shared configuration
#[tokio::test]
async fn shared_config_testbed() {
let shared_config = aws... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | 5f4378d3e820cebbb6b7e7413d4592c7d5441559 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5f4378d3e820cebbb6b7e7413d4592c7d5441559/sdk/dynamodb/tests/shared-config.rs | 1 | 25 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use aws_sdk_dynamodb::{Credentials, Region};
use http::Uri;
/// Iterative test of loading clients from shared configuration
#[tokio::test]
async fn shared_config_testbed() {
let shared_config = aws... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | 6c874ba3c63387254ecd00d651fe04c367070132 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/6c874ba3c63387254ecd00d651fe04c367070132/sdk/dynamodb/tests/shared-config.rs | 1 | 25 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/shared-config.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
use aws_sdk_dynamodb::{Credentials, Region};
use http::Uri;
/// Iterative test of loading clients from shared configuration
#[tokio::test]
async fn shared_config_testbed() {
let shared_config = aws... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/shared-config.rs | Apache-2.0 | 74cd8a14231e1a005a2f554b072fc9782def5519 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/74cd8a14231e1a005a2f554b072fc9782def5519/sdk/dynamodb/tests/shared-config.rs | 1 | 25 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/test-error-classification.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use std::time::Duration;
use aws_credential_types::Credentials;
use aws_sdk_dynamodb::types::AttributeValue;
use aws_sdk_dynamodb::Client;
use aws_smithy_async::rt::sleep::{SharedAsyncSleep, TokioSleep}... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/test-error-classification.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/test-error-classification.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/test-error-classification.rs:2 | async fn assert_error_not_transient(error: ReplayedEvent) {
let mock = WireMockServer::start(vec![
error,
ReplayedEvent::with_body(DYNAMODB_DB_SUCCESS_RESPONSE),
])
.await;
let config = aws_sdk_dynamodb::Config::builder()
.region(Region::from_static("us-east-2"))
.creden... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/test-error-classification.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/test-error-classification.rs | 41 | 70 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/test-error-classification.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use std::time::Duration;
use aws_credential_types::Credentials;
use aws_sdk_dynamodb::types::AttributeValue;
use aws_sdk_dynamodb::Client;
use aws_smithy_async::rt::sleep::{SharedAsyncSleep, TokioSleep}... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/test-error-classification.rs | Apache-2.0 | 21f0293e3a809313699a174d195b03e0ab2e4772 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/21f0293e3a809313699a174d195b03e0ab2e4772/sdk/dynamodb/tests/test-error-classification.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/test-error-classification.rs:2 | async fn assert_error_not_transient(error: ReplayedEvent) {
let mock = WireMockServer::start(vec![
error,
ReplayedEvent::with_body(DYNAMODB_DB_SUCCESS_RESPONSE),
])
.await;
let config = aws_sdk_dynamodb::Config::builder()
.region(Region::from_static("us-east-2"))
.creden... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/test-error-classification.rs | Apache-2.0 | a0ddad15fca029a888f717b770fda078541546c4 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/a0ddad15fca029a888f717b770fda078541546c4/sdk/dynamodb/tests/test-error-classification.rs | 41 | 70 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/timeouts.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use std::time::Duration;
use aws_credential_types::provider::SharedCredentialsProvider;
use aws_sdk_dynamodb::config::{Credentials, Region, StalledStreamProtectionConfig};
use aws_sdk_dynamodb::error::S... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/timeouts.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/timeouts.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/timeouts.rs:2 | let client = aws_sdk_dynamodb::Client::new(&conf);
let resp = client
.list_tables()
.send()
.await
.expect_err("call should fail");
assert_eq!(
http_client.num_calls(),
3,
"client level timeouts should be retried"
);
assert!(
matches!(resp,... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/timeouts.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/timeouts.rs | 41 | 91 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/timeouts.rs:3 | assert_eq!(
http_client.num_calls(),
1,
"operation level timeouts should not be retried"
);
assert!(
matches!(resp, SdkError::TimeoutError { .. }),
"expected a timeout error, got: {}",
resp
);
} | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/timeouts.rs | Apache-2.0 | 5e17b3723799bff475dc95cdcca40c9d54602f18 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5e17b3723799bff475dc95cdcca40c9d54602f18/sdk/dynamodb/tests/timeouts.rs | 81 | 91 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/timeouts.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use std::time::Duration;
use aws_credential_types::provider::SharedCredentialsProvider;
use aws_sdk_dynamodb::config::{Credentials, Region, StalledStreamProtectionConfig};
use aws_sdk_dynamodb::error::S... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/timeouts.rs | Apache-2.0 | 5370d2af59d5b60d5683509317096554e3afbeef | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/5370d2af59d5b60d5683509317096554e3afbeef/sdk/dynamodb/tests/timeouts.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/dynamodb/tests/timeouts.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
use std::time::Duration;
use aws_credential_types::provider::SharedCredentialsProvider;
use aws_credential_types::Credentials;
use aws_sdk_dynamodb::error::SdkError;
use aws_smithy_async::rt::sleep::{As... | rust | rust | testsuite | awslabs/aws-sdk-rust | sdk/dynamodb/tests/timeouts.rs | Apache-2.0 | 55aa7275a4a080ca6c3b74b77d5f86d37dbb7720 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/55aa7275a4a080ca6c3b74b77d5f86d37dbb7720/sdk/dynamodb/tests/timeouts.rs | 1 | 60 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.