MCPcopy Create free account
hub / github.com/ExtendDB/extenddb / test_export_empty_table

Method test_export_empty_table

tests/test_import_export.py:141–166  ·  view source on GitHub ↗

Export an empty table produces empty file.

(self, dynamodb_client, unique_table_name, cleanup_table)

Source from the content-addressed store, hash-verified

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# ---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 5

wait_for_activeFunction · 0.90
cleanup_tableFunction · 0.85
extenddb_requestFunction · 0.85
create_tableMethod · 0.80
describe_tableMethod · 0.80

Tested by

no test coverage detected