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

Function condition_table

tests/test_conditional_writes.py:44–65  ·  view source on GitHub ↗

Table with pk (HASH) + sk (RANGE) for condition tests.

(dynamodb_client)

Source from the content-addressed store, hash-verified

42
43@pytest.fixture()
44def 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
68class TestConditionalPutItem:

Callers

nothing calls this directly

Calls 4

wait_for_activeFunction · 0.90
wait_for_deletedFunction · 0.90
create_tableMethod · 0.80
delete_tableMethod · 0.80

Tested by

no test coverage detected