Table with pk (HASH) + sk (RANGE) for condition tests.
(dynamodb_client)
| 42 | |
| 43 | @pytest.fixture() |
| 44 | def condition_table(dynamodb_client): |
| 45 | """Table with pk (HASH) + sk (RANGE) for condition tests.""" |
| 46 | name = f"extenddb-cond-{uuid.uuid4().hex[:8]}" |
| 47 | dynamodb_client.create_table( |
| 48 | TableName=name, |
| 49 | KeySchema=[ |
| 50 | {"AttributeName": "pk", "KeyType": "HASH"}, |
| 51 | {"AttributeName": "sk", "KeyType": "RANGE"}, |
| 52 | ], |
| 53 | AttributeDefinitions=[ |
| 54 | {"AttributeName": "pk", "AttributeType": "S"}, |
| 55 | {"AttributeName": "sk", "AttributeType": "S"}, |
| 56 | ], |
| 57 | BillingMode="PAY_PER_REQUEST", |
| 58 | ) |
| 59 | wait_for_active(dynamodb_client, name) |
| 60 | yield name |
| 61 | try: |
| 62 | dynamodb_client.delete_table(TableName=name) |
| 63 | wait_for_deleted(dynamodb_client, name) |
| 64 | except Exception: |
| 65 | pass |
| 66 | |
| 67 | |
| 68 | class TestConditionalPutItem: |
nothing calls this directly
no test coverage detected