Skip to content

Commit

Permalink
Admin: Fix AWS parity tests (#7720)
Browse files Browse the repository at this point in the history
  • Loading branch information
bblommers authored May 26, 2024
1 parent 83154c6 commit 4501f37
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/test_dynamodb/test_dynamodb_update_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ def test_update_item_add_empty_set(table_name=None):
err = exc.value.response["Error"]
assert err["Code"] == "ValidationException"
assert (
err["Message"]
== "ExpressionAttributeValues contains invalid value: One or more parameter values were invalid: An string set may not be empty"
"ExpressionAttributeValues contains invalid value: One or more parameter values were invalid: An string set may not be empty"
in err["Message"]
)

assert dynamodb.scan(TableName=table_name)["Items"] == [{"pk": {"S": "foo"}}]
Expand Down
11 changes: 11 additions & 0 deletions tests/test_s3/test_s3_logging.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
from time import sleep
from unittest import SkipTest
from unittest.mock import patch
from uuid import uuid4
Expand Down Expand Up @@ -620,6 +621,11 @@ def test_put_logging_w_bucket_policy_no_prefix(bucket_name=None):
},
)
result = s3_client.get_bucket_logging(Bucket=bucket_name)
# Logging Config is not immediately available
for _ in range(5):
if "LoggingEnabled" not in result:
sleep(1)
result = s3_client.get_bucket_logging(Bucket=bucket_name)
assert result["LoggingEnabled"]["TargetBucket"] == log_bucket_name
assert result["LoggingEnabled"]["TargetPrefix"] == ""

Expand Down Expand Up @@ -657,6 +663,11 @@ def test_put_logging_w_bucket_policy_w_prefix(bucket_name=None):
},
)
result = s3_client.get_bucket_logging(Bucket=bucket_name)
# Logging Config is not immediately available
for _ in range(5):
if "LoggingEnabled" not in result:
sleep(1)
result = s3_client.get_bucket_logging(Bucket=bucket_name)
assert result["LoggingEnabled"]["TargetBucket"] == log_bucket_name
assert result["LoggingEnabled"]["TargetPrefix"] == prefix

Expand Down
4 changes: 2 additions & 2 deletions tests/test_sns/test_application_boto3.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,9 @@ def test_publish_to_deleted_platform_endpoint(api_key=None):
== f"Invalid parameter: Endpoint Reason: Endpoint does not exist for endpoint arn{endpoint_arn}"
)
finally:
if application_arn is not None:
if topic_arn is not None:
conn.delete_topic(TopicArn=topic_arn)

if application_arn is not None:
conn.delete_platform_application(PlatformApplicationArn=application_arn)


Expand Down

0 comments on commit 4501f37

Please sign in to comment.