Skip to content

Commit 05ea742

Browse files
m
1 parent 4ba1345 commit 05ea742

File tree

3 files changed

+35
-21
lines changed

3 files changed

+35
-21
lines changed

TestVectors/runtimes/python/src/dbesdk_ddb_test_vectors/internaldafny/extern/CreateInterceptedDDBTable.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -200,25 +200,6 @@ def get_item(self, **kwargs):
200200
client_output = self._table_shape_to_client_shape_converter.get_item_response(table_output)
201201
return client_output
202202

203-
def _convert_batch_write_item_request_from_dynamo_to_dict(self, **kwargs):
204-
for table, requests in kwargs["RequestItems"].items():
205-
dict_requests = []
206-
for request in requests:
207-
request_name_list = list(request.keys())
208-
if len(request_name_list) > 1:
209-
raise ValueError("Cannot send more than one request in a single request")
210-
request_name = request_name_list[0]
211-
if request_name == "PutRequest":
212-
dict_request = ddb_to_dict(request[request_name]["Item"])
213-
dict_requests.append({request_name: {"Item": dict_request}})
214-
elif request_name == "DeleteRequest":
215-
dict_request = ddb_to_dict(request[request_name]["Key"])
216-
dict_requests.append({request_name: {"Key": dict_request}})
217-
else:
218-
raise ValueError(f"Unknown batch_write_items method key: {request_name}")
219-
kwargs["RequestItems"][table] = dict_requests
220-
return kwargs
221-
222203
def batch_write_item(self, **kwargs):
223204
# print(f"batch_write_item {kwargs=}")
224205
# Parse boto3 client.batch_write_item input into table.batch_writer() calls

TestVectors/runtimes/python/test/resource/test_dafny_wrapper.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,33 @@
1919
import dbesdk_ddb_test_vectors.internaldafny.extern.CreateInterceptedDDBResource
2020
import dbesdk_ddb_test_vectors.internaldafny.extern.CreateWrappedDictItemEncryptor
2121

22+
# Remove invalid tests.
23+
# Supported operations on `resource` that are also supported by DBESDK are:
24+
# - batch_get_item
25+
# - batch_write_item
26+
# Unsupported operations on `resource` are that are supported by DBESDK are:
27+
# - put_item
28+
# - get_item
29+
# - query
30+
# - scan
31+
# - transact_get_items
32+
# - transact_write_items
33+
# Remove any tests that call unsupported operations.
34+
# If more tests that call these operations are added, remove them below.
35+
# If the list below becomes unmaintainable,
36+
# or if other languages add clients with unsupported operations,
37+
# refactor the Dafny code to conditionally call tests
38+
# based on whether the client supports the operation under test.
39+
40+
def EmptyTest(*args):
41+
pass
42+
43+
dbesdk_ddb_test_vectors.internaldafny.generated.DdbEncryptionTestVectors.TestVectorConfig.BasicIoTestPutItem = EmptyTest
44+
dbesdk_ddb_test_vectors.internaldafny.generated.DdbEncryptionTestVectors.TestVectorConfig.BasicIoTestTransactWriteItems = EmptyTest
45+
dbesdk_ddb_test_vectors.internaldafny.generated.DdbEncryptionTestVectors.TestVectorConfig.BasicQueryTest = EmptyTest
46+
dbesdk_ddb_test_vectors.internaldafny.generated.DdbEncryptionTestVectors.TestVectorConfig.BasicIoTestGetItem = EmptyTest
47+
dbesdk_ddb_test_vectors.internaldafny.generated.DdbEncryptionTestVectors.TestVectorConfig.BasicIoTestScan = EmptyTest
48+
dbesdk_ddb_test_vectors.internaldafny.generated.DdbEncryptionTestVectors.TestVectorConfig.BasicIoTestTransactGetItems = EmptyTest
49+
2250
def test_dafny():
2351
from ..internaldafny.generated import __main__

TestVectors/runtimes/python/test/table/test_dafny_wrapper.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@
2020
import dbesdk_ddb_test_vectors.internaldafny.extern.CreateWrappedDictItemEncryptor
2121

2222
# Remove invalid tests.
23-
# Unsupported operations on `table` are:
23+
# Supported operations on `table` that are also supported by DBESDK are:
24+
# - put_item
25+
# - get_item
26+
# - query
27+
# - scan
28+
# Unsupported operations on `table` are that are supported by DBESDK are:
2429
# - transact_get_items
2530
# - transact_write_items
2631
# - batch_get_item
27-
# Remove any tests that call these operations.
32+
# Remove any tests that call unsupported operations.
2833
# If more tests that call these operations are added, remove them below.
2934
# If the list below becomes unmaintainable,
3035
# or if other languages add clients with unsupported operations,

0 commit comments

Comments
 (0)