Export an empty table produces empty file.
(self, dynamodb_client, unique_table_name, cleanup_table)
| 139 | os.unlink(export_path) |
| 140 | |
| 141 | def test_export_empty_table(self, dynamodb_client, unique_table_name, cleanup_table): |
| 142 | """Export an empty table produces empty file.""" |
| 143 | name = unique_table_name |
| 144 | cleanup_table(name) |
| 145 | dynamodb_client.create_table( |
| 146 | TableName=name, |
| 147 | AttributeDefinitions=[{"AttributeName": "pk", "AttributeType": "S"}], |
| 148 | KeySchema=[{"AttributeName": "pk", "KeyType": "HASH"}], |
| 149 | BillingMode="PAY_PER_REQUEST", |
| 150 | ) |
| 151 | wait_for_active(dynamodb_client, name) |
| 152 | |
| 153 | desc = dynamodb_client.describe_table(TableName=name) |
| 154 | table_arn = desc["Table"]["TableArn"] |
| 155 | |
| 156 | with tempfile.NamedTemporaryFile(suffix=".json", delete=False) as f: |
| 157 | export_path = f.name |
| 158 | |
| 159 | try: |
| 160 | resp = extenddb_request("ExportTableToPointInTime", { |
| 161 | "TableArn": table_arn, |
| 162 | "FilePath": export_path, |
| 163 | }) |
| 164 | assert resp["ExportDescription"]["ItemCount"] == 0 |
| 165 | finally: |
| 166 | os.unlink(export_path) |
| 167 | # --------------------------------------------------------------------------- |
| 168 | # ImportTable |
| 169 | # --------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected