()
| 136 | |
| 137 | #[tokio::test] |
| 138 | async fn scan_empty_table() { |
| 139 | let c = client(); |
| 140 | let table = format!("ScanEmpty_{}", ts()); |
| 141 | use aws_sdk_dynamodb::types::{ |
| 142 | AttributeDefinition, BillingMode, KeySchemaElement, KeyType, ScalarAttributeType, |
| 143 | }; |
| 144 | c.create_table() |
| 145 | .table_name(&table) |
| 146 | .billing_mode(BillingMode::PayPerRequest) |
| 147 | .key_schema( |
| 148 | KeySchemaElement::builder() |
| 149 | .attribute_name(HASH_KEY_S) |
| 150 | .key_type(KeyType::Hash) |
| 151 | .build() |
| 152 | .unwrap(), |
| 153 | ) |
| 154 | .attribute_definitions( |
| 155 | AttributeDefinition::builder() |
| 156 | .attribute_name(HASH_KEY_S) |
| 157 | .attribute_type(ScalarAttributeType::S) |
| 158 | .build() |
| 159 | .unwrap(), |
| 160 | ) |
| 161 | .send() |
| 162 | .await |
| 163 | .unwrap(); |
| 164 | wait_for_active(c, &table).await; |
| 165 | |
| 166 | let resp = c.scan().table_name(&table).send().await.unwrap(); |
| 167 | assert_eq!(resp.count(), 0); |
| 168 | assert!(resp.items().is_empty()); |
| 169 | } |
| 170 | |
| 171 | #[tokio::test] |
| 172 | async fn scan_non_existent_table() { |
nothing calls this directly
no test coverage detected