From 8b90a75aa011ab890cb0951c817844975682f424 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Fri, 23 Aug 2019 17:17:10 +0300 Subject: [PATCH] issues-2386 make comparing exists and new queues only by static attrs --- moto/sqs/models.py | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/moto/sqs/models.py b/moto/sqs/models.py index e774e261c..c7386b52f 100644 --- a/moto/sqs/models.py +++ b/moto/sqs/models.py @@ -424,13 +424,26 @@ class SQSBackend(BaseBackend): queue_attributes = queue.attributes new_queue_attributes = new_queue.attributes + static_attributes = ( + 'DelaySeconds', + 'MaximumMessageSize', + 'MessageRetentionPeriod', + 'Policy', + 'QueueArn', + 'ReceiveMessageWaitTimeSeconds', + 'RedrivePolicy', + 'VisibilityTimeout', + 'KmsMasterKeyId', + 'KmsDataKeyReusePeriodSeconds', + 'FifoQueue', + 'ContentBasedDeduplication', + ) - for key in ['CreatedTimestamp', 'LastModifiedTimestamp']: - queue_attributes.pop(key) - new_queue_attributes.pop(key) - - if queue_attributes != new_queue_attributes: - raise QueueAlreadyExists("The specified queue already exists.") + for key in static_attributes: + if queue_attributes.get(key) != new_queue_attributes.get(key): + raise QueueAlreadyExists( + "The specified queue already exists.", + ) else: try: kwargs.pop('region')