Skip to content

Commit 34624b5

Browse files
author
Lucas McDonald
committed
m
1 parent 6f24541 commit 34624b5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

DynamoDbEncryption/runtimes/python/test/unit/encrypted/test_paginator.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,17 @@ def test_GIVEN_kwargs_has_PaginationConfig_WHEN_paginate_THEN_PaginationConfig_i
6161
mock_input_transform_method.assert_called_once_with(
6262
QueryInputTransformInput(sdk_input=kwargs_without_pagination_config)
6363
)
64+
65+
def test_GIVEN_invalid_class_attribute_WHEN_getattr_THEN_raise_error():
66+
# Create a mock with a specific spec that excludes our unknown attribute
67+
mock_boto3_dynamodb_client = MagicMock(spec=["put_item", "get_item", "query", "scan"])
68+
encrypted_paginator = EncryptedPaginator(
69+
paginator=mock_boto3_dynamodb_client,
70+
encryption_config=mock_tables_encryption_config,
71+
)
72+
73+
# Then: AttributeError is raised
74+
with pytest.raises(AttributeError):
75+
# Given: Invalid class attribute: not_a_valid_attribute_on_EncryptedClient_nor_boto3_client
76+
# When: getattr is called
77+
encrypted_paginator.not_a_valid_attribute_on_EncryptedPaginator_nor_boto3_paginator()

0 commit comments

Comments
 (0)