Skip to content

Commit a5adf68

Browse files
author
Lucas McDonald
committed
m
1 parent f194796 commit a5adf68

File tree

5 files changed

+23
-18
lines changed

5 files changed

+23
-18
lines changed

TestVectors/runtimes/python/src/aws_dbesdk_dynamodb_test_vectors/internaldafny/extern/CreateInterceptedDDBResource.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from aws_dbesdk_dynamodb.encrypted.resource import EncryptedResource
88
from smithy_dafny_standard_library.internaldafny.generated import Wrappers
99
from aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.errors import _smithy_error_to_dafny_error
10-
from aws_dbesdk_dynamodb_test_vectors.waiting_boto3_ddb_client import WaitingDynamoClient
10+
from aws_dbesdk_dynamodb_test_vectors.waiting_boto3_ddb_client import WaitingLocalDynamoClient
1111
from aws_dbesdk_dynamodb.transform import (
1212
dict_to_ddb,
1313
ddb_to_dict,
@@ -139,15 +139,15 @@ class default__:
139139
@staticmethod
140140
def CreateVanillaDDBClient():
141141
try:
142-
return aws_cryptography_internal_dynamodb.internaldafny.extern.Com_Amazonaws_Dynamodb.default__.DynamoDBClient(WaitingDynamoClient())
142+
return aws_cryptography_internal_dynamodb.internaldafny.extern.Com_Amazonaws_Dynamodb.default__.DynamoDBClient(WaitingLocalDynamoClient())
143143
except Exception as e:
144144
return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e))
145145

146146
@staticmethod
147147
def CreateInterceptedDDBClient(dafny_encryption_config):
148148
try:
149149
native_encryption_config = aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbTablesEncryptionConfig(dafny_encryption_config)
150-
boto3_client = WaitingDynamoClient()
150+
boto3_client = WaitingLocalDynamoClient()
151151
table_config_names = list(native_encryption_config.table_encryption_configs.keys())
152152
if len(table_config_names) > 1:
153153
raise ValueError("TODO more than 1 table; need EncryptedTablesManager")

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from aws_dbesdk_dynamodb.internal.client_to_resource import ClientShapeToResourceShapeConverter
1111
from smithy_dafny_standard_library.internaldafny.generated import Wrappers
1212
from aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.errors import _smithy_error_to_dafny_error
13-
from aws_dbesdk_dynamodb_test_vectors.waiting_boto3_ddb_client import WaitingDynamoClient
13+
from aws_dbesdk_dynamodb_test_vectors.waiting_boto3_ddb_client import WaitingLocalDynamoClient
1414
from aws_dbesdk_dynamodb.transform import (
1515
dict_to_ddb,
1616
ddb_to_dict,
@@ -442,15 +442,15 @@ class default__:
442442
@staticmethod
443443
def CreateVanillaDDBClient():
444444
try:
445-
return aws_cryptography_internal_dynamodb.internaldafny.extern.Com_Amazonaws_Dynamodb.default__.DynamoDBClient(WaitingDynamoClient())
445+
return aws_cryptography_internal_dynamodb.internaldafny.extern.Com_Amazonaws_Dynamodb.default__.DynamoDBClient(WaitingLocalDynamoClient())
446446
except Exception as e:
447447
return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e))
448448

449449
@staticmethod
450450
def CreateInterceptedDDBClient(dafny_encryption_config):
451451
try:
452452
native_encryption_config = aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbTablesEncryptionConfig(dafny_encryption_config)
453-
boto3_client = WaitingDynamoClient()
453+
boto3_client = WaitingLocalDynamoClient()
454454
table_config_names = list(native_encryption_config.table_encryption_configs.keys())
455455
if len(table_config_names) > 1:
456456
raise ValueError("TODO more than 1 table; need EncryptedTablesManager")

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

+3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
sys.path.append(test_dir + "/internaldafny/extern")
1717
sys.path.append(test_dir + "/internaldafny/generated")
1818

19+
# Import extern to use an EncryptedClient as the wrapped DBESDK client.
1920
import aws_dbesdk_dynamodb_test_vectors.internaldafny.extern.CreateInterceptedDDBClient
21+
# Import extern to use the ItemEncryptor with DDB JSON-formatted items.
22+
# (EncryptedClients use DDB JSON-formatted items by default.)
2023
import aws_dbesdk_dynamodb_test_vectors.internaldafny.extern.CreateWrappedDynamoDbItemEncryptor
2124

2225
def test_dafny():

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

+7-5
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,24 @@
2626
# Supported operations on Resources that are also supported by DBESDK are:
2727
# - batch_get_item
2828
# - batch_write_item
29+
# https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/index.html
30+
#
2931
# However, Resources can provide Tables.
3032
# Unsupported operations on Resources are that are supported by provided Tables are:
3133
# - put_item
3234
# - get_item
3335
# - query
3436
# - scan
37+
# https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/index.html#DynamoDB.Table
3538
# These operations will be tested on EncryptedResources via provided EncryptedTables.
39+
#
3640
# Unsupported operations on both Resources and Tables are that are supported by DBESDK are:
3741
# - transact_get_items
3842
# - transact_write_items
39-
# Remove any tests that call unsupported operations.
43+
# Remove any tests that call unsupported operations by overriding the test method to do nothing..
4044
# If more tests that call these operations are added, remove them below.
41-
# If the list below becomes unmaintainable,
42-
# or if other languages add clients with unsupported operations,
43-
# refactor the Dafny code to conditionally call tests
44-
# based on whether the client supports the operation under test.
45+
# If the list below becomes unmaintainable, or if other languages add clients with unsupported operations,
46+
# refactor the Dafny code to conditionally call tests based on whether the client supports the operation under test.
4547

4648
def EmptyTest(*args):
4749
pass

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@
2020
import aws_dbesdk_dynamodb_test_vectors.internaldafny.extern.CreateWrappedDictItemEncryptor
2121

2222
# Remove invalid tests.
23-
# Supported operations on `table` that are also supported by DBESDK are:
23+
# Supported operations on Tables that are also supported by DBESDK are:
2424
# - put_item
2525
# - get_item
2626
# - query
2727
# - scan
28-
# Unsupported operations on `table` are that are supported by DBESDK are:
28+
# https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/index.html#DynamoDB.Table
29+
#
30+
# Unsupported operations on Tables are that are supported by DBESDK are:
2931
# - transact_get_items
3032
# - transact_write_items
3133
# - batch_get_item
32-
# Remove any tests that call unsupported operations.
34+
# Remove any tests that call unsupported operations by overriding the test method to do nothing.
3335
# If more tests that call these operations are added, remove them below.
34-
# If the list below becomes unmaintainable,
35-
# or if other languages add clients with unsupported operations,
36-
# refactor the Dafny code to conditionally call tests
37-
# based on whether the client supports the operation under test.
36+
# If the list below becomes unmaintainable, or if other languages add clients with unsupported operations,
37+
# refactor the Dafny code to conditionally call tests based on whether the client supports the operation under test.
3838

3939
def EmptyTest(*args):
4040
pass

0 commit comments

Comments
 (0)