sunank200 commented on code in PR #31940:
URL: https://github.com/apache/airflow/pull/31940#discussion_r1245162718


##########
tests/providers/amazon/aws/triggers/test_s3.py:
##########
@@ -75,3 +75,80 @@ async def test_run_pending(self, mock_client, 
mock_check_key_async):
 
         assert task.done() is False
         asyncio.get_event_loop().stop()
+
+
+class TestS3KeysUnchangedTrigger:
+    def test_serialization(self):
+        """
+        Asserts that the TaskStateTrigger correctly serializes its arguments
+        and classpath.
+        """
+        trigger = S3KeysUnchangedTrigger(
+            bucket_name="test_bucket",
+            prefix="test",
+            inactivity_period=1,
+            min_objects=1,
+            inactivity_seconds=0,
+            previous_objects=None,
+        )
+        classpath, kwargs = trigger.serialize()
+        assert classpath == 
"airflow.providers.amazon.aws.triggers.s3.S3KeysUnchangedTrigger"
+        assert kwargs == {
+            "bucket_name": "test_bucket",
+            "prefix": "test",
+            "inactivity_period": 1,
+            "min_objects": 1,
+            "inactivity_seconds": 0,
+            "previous_objects": set(),
+            "allow_delete": 1,
+            "aws_conn_id": "aws_default",
+            "last_activity_time": None,
+            "hook_params": {},
+        }
+
+    @pytest.mark.asyncio
+    
@async_mock.patch("airflow.providers.amazon.aws.triggers.s3.S3Hook.async_conn")
+    async def test_run_wait(self, mock_client):
+        """Test if the task is run is in trigger successfully."""

Review Comment:
   fixed 
https://github.com/apache/airflow/pull/31940/commits/f9bd957404d9b5b45ceb33d00a1c37b8670f8cf5



##########
tests/providers/amazon/aws/triggers/test_s3.py:
##########
@@ -75,3 +75,80 @@ async def test_run_pending(self, mock_client, 
mock_check_key_async):
 
         assert task.done() is False
         asyncio.get_event_loop().stop()
+
+
+class TestS3KeysUnchangedTrigger:
+    def test_serialization(self):
+        """
+        Asserts that the TaskStateTrigger correctly serializes its arguments

Review Comment:
   fixed 
https://github.com/apache/airflow/pull/31940/commits/f9bd957404d9b5b45ceb33d00a1c37b8670f8cf5



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