Create and populate a table for export tests.
(self, dynamodb_client, unique_table_name, cleanup_table)
| 88 | |
| 89 | @pytest.fixture() |
| 90 | def populated_table(self, dynamodb_client, unique_table_name, cleanup_table): |
| 91 | """Create and populate a table for export tests.""" |
| 92 | name = unique_table_name |
| 93 | cleanup_table(name) |
| 94 | dynamodb_client.create_table( |
| 95 | TableName=name, |
| 96 | AttributeDefinitions=[{"AttributeName": "pk", "AttributeType": "S"}], |
| 97 | KeySchema=[{"AttributeName": "pk", "KeyType": "HASH"}], |
| 98 | BillingMode="PAY_PER_REQUEST", |
| 99 | ) |
| 100 | wait_for_active(dynamodb_client, name) |
| 101 | |
| 102 | for i in range(5): |
| 103 | dynamodb_client.put_item( |
| 104 | TableName=name, |
| 105 | Item={"pk": {"S": f"item-{i}"}, "data": {"S": f"value-{i}"}}, |
| 106 | ) |
| 107 | return name |
| 108 | |
| 109 | def test_export_dynamodb_json(self, dynamodb_client, populated_table): |
| 110 | """Export table to DYNAMODB_JSON format.""" |
nothing calls this directly
no test coverage detected