TyrellHaywood commented on code in PR #56371:
URL: https://github.com/apache/airflow/pull/56371#discussion_r2433462010


##########
providers/amazon/tests/unit/amazon/aws/hooks/test_sqs.py:
##########
@@ -24,18 +24,130 @@
 
 from airflow.providers.amazon.aws.hooks.sqs import SqsHook
 
+QUEUE_NAME = "test-queue"
 QUEUE_URL = "https://sqs.region.amazonaws.com/123456789/test-queue";
 MESSAGE_BODY = "test message"
 
+DELAY = 5
+DEDUPE = "banana"
+MSG_ATTRIBUTES = {
+    "Author": {
+        "StringValue": "test-user",
+        "DataType": "String",
+    },
+    "Priority": {
+        "StringValue": "1",
+        "DataType": "Number",
+    },
+}
+
 MESSAGE_ID_KEY = "MessageId"
 
+SEND_MESSAGE_DEFAULTS = {
+    "DelaySeconds": 0,
+    "MessageAttributes": {},
+}
+
 
+@mock_aws
 class TestSqsHook:
-    @mock_aws
-    def test_get_conn(self):
+    @pytest.fixture(autouse=True)
+    def setup_test_queue(self):
+        """Create a test queue before each test."""
         hook = SqsHook(aws_conn_id="aws_default")
+        self.queue_url = hook.create_queue(queue_name=QUEUE_NAME)
+        yield
+
+    @pytest.fixture
+    def hook(self):
+        return SqsHook(aws_conn_id="aws_default")
+
+    def test_get_conn(self, hook):
         assert hook.get_conn() is not None
 
+    def test_create_queue(self, hook):
+        """Test that create_queue creates a queue and returns the queue URL."""
+        queue_name = "test-create-queue"
+        queue_url = hook.create_queue(queue_name=queue_name)
+
+        assert isinstance(queue_url, str)
+        assert queue_name in queue_url
+
+    def test_create_queue_with_attributes(self, hook):
+        """Test creating a queue with custom attributes."""
+        queue_name = "test-queue-with-attributes"
+        attributes = {
+            "DelaySeconds": "5",

Review Comment:
   Fixed, updated the test to use global constants (DELAY, MSG_ATTRIBUTES) 
throughout the tests instead of magic strings. Thanks for catching that! I also 
added another (MAX_MESSAGE_SIZE) to this issue on lines 82 and 95



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to