hankehly commented on code in PR #26003:
URL: https://github.com/apache/airflow/pull/26003#discussion_r962438077


##########
tests/providers/amazon/aws/sensors/test_rds.py:
##########
@@ -225,3 +233,67 @@ def test_export_task_poke_false(self):
             dag=self.dag,
         )
         assert not op.poke(None)
+
+
[email protected](mock_rds is None, reason="mock_rds package not present")
+class TestRdsDbSensor:
+    @classmethod
+    def setup_class(cls):
+        cls.dag = DAG("test_dag", default_args={"owner": "airflow", 
"start_date": DEFAULT_DATE})
+        cls.hook = RdsHook(aws_conn_id=AWS_CONN, region_name="us-east-1")
+
+    @classmethod
+    def teardown_class(cls):
+        del cls.dag
+        del cls.hook
+
+    @mock_rds
+    def test_poke_true_instance(self):
+        """
+        By default RdsDbSensor should wait for an instance to enter the 
'available' state
+        """
+        _create_db_instance(self.hook)
+        op = RdsDbSensor(
+            task_id="instance_poke_true",
+            db_identifier=DB_INSTANCE_NAME,
+            aws_conn_id=AWS_CONN,
+            dag=self.dag,
+        )
+        assert op.poke(None)
+
+    @mock_rds
+    def test_poke_false_instance(self):
+        _create_db_instance(self.hook)
+        op = RdsDbSensor(
+            task_id="instance_poke_false",
+            db_identifier=DB_INSTANCE_NAME,
+            target_statuses=["stopped"],
+            aws_conn_id=AWS_CONN,
+            dag=self.dag,
+        )
+        assert not op.poke(None)
+
+    @mock_rds
+    def test_poke_true_cluster(self):
+        _create_db_cluster(self.hook)
+        op = RdsDbSensor(

Review Comment:
   2022/09/05 update 
(https://github.com/apache/airflow/pull/26003/commits/0d537b1bdf1fa3dbd8a94f1b635a5814e84e11e9)
   Added unit test cases for "cluster" db type



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