Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f194796

Browse files
author
Lucas McDonald
committedApr 17, 2025·
m
1 parent 25d3f05 commit f194796

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed
 

‎TestVectors/runtimes/python/src/aws_dbesdk_dynamodb_test_vectors/internaldafny/extern/CreateInterceptedDDBClient.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
from aws_dbesdk_dynamodb.encrypted.client import EncryptedClient
66
from smithy_dafny_standard_library.internaldafny.generated import Wrappers
77
from aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.errors import _smithy_error_to_dafny_error
8-
from aws_dbesdk_dynamodb_test_vectors.waiting_boto3_ddb_client import WaitingDynamoClient
8+
from aws_dbesdk_dynamodb_test_vectors.waiting_boto3_ddb_client import WaitingLocalDynamoClient
99

1010
class default__:
1111
@staticmethod
1212
def CreateVanillaDDBClient():
1313
try:
14-
return aws_cryptography_internal_dynamodb.internaldafny.extern.Com_Amazonaws_Dynamodb.default__.DynamoDBClient(WaitingDynamoClient())
14+
return aws_cryptography_internal_dynamodb.internaldafny.extern.Com_Amazonaws_Dynamodb.default__.DynamoDBClient(WaitingLocalDynamoClient())
1515
except Exception as e:
1616
return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e))
1717

1818
@staticmethod
1919
def CreateInterceptedDDBClient(dafny_encryption_config):
2020
try:
2121
native_encryption_config = aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbTablesEncryptionConfig(dafny_encryption_config)
22-
boto3_client = WaitingDynamoClient()
22+
boto3_client = WaitingLocalDynamoClient()
2323
encrypted_client = EncryptedClient(client = boto3_client, encryption_config = native_encryption_config)
2424
return aws_cryptography_internal_dynamodb.internaldafny.extern.Com_Amazonaws_Dynamodb.default__.DynamoDBClient(encrypted_client)
2525
except Exception as e:

‎TestVectors/runtimes/python/src/aws_dbesdk_dynamodb_test_vectors/waiting_boto3_ddb_client.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
class WaitingLocalDynamoClient:
44
"""
55
boto3 DynamoDB client wrapper that wraps `create_table` and `delete_table` methods
6-
and connects to localhost:8000.
7-
If these methods are called on this client, they will block returning until
6+
and connects to localhost:8000.
7+
If overridden methods are called on this client, they will block returning until
88
the table is created/deleted.
99
This is the expected behavior of SDK clients in our Dafny code.
1010
All other methods besides these are unchanged and will call the boto3 client directly.
@@ -14,7 +14,6 @@ def __init__(self):
1414

1515
def __getattr__(self, name):
1616
if hasattr(self._client, name):
17-
print(f'calling underlyign client {name=}')
1817
original_method = getattr(self._client, name)
1918

2019
if name == 'create_table':
@@ -46,4 +45,4 @@ def wrapper(*args, **kwargs):
4645
waiter.wait(TableName=table_name)
4746
print(f"Table '{table_name}' has been deleted.")
4847
return response
49-
return wrapper
48+
return wrapper

0 commit comments

Comments
 (0)
Please sign in to comment.