uranusjr commented on code in PR #25881:
URL: https://github.com/apache/airflow/pull/25881#discussion_r952099310


##########
tests/providers/amazon/aws/hooks/test_sns.py:
##########
@@ -79,3 +79,26 @@ def test_publish_to_target_plain(self):
         response = hook.publish_to_target(target, message)
 
         assert 'MessageId' in response
+
+    @mock_sns
+    def test_publish_to_target_error(self):
+        hook = SnsHook(aws_conn_id='aws_default')
+
+        message = "Hello world"
+        topic_name = "test-topic"
+        target = hook.get_conn().create_topic(Name=topic_name).get('TopicArn')
+
+        with self.assertRaises(TypeError) as ctx:
+            hook.publish_to_target(
+                target,
+                message,
+                message_attributes={
+                    'test-non-iterable': object(),
+                },
+            )
+
+        self.assertEqual(
+            """Values in MessageAttributes must be one of bytes, str, int, 
float, """
+            """or iterable; got <class 'object'>""",

Review Comment:
   ```suggestion
               "Values in MessageAttributes must be one of bytes, str, int, 
float, "
               "or iterable; got <class 'object'>",
   ```



-- 
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