vincbeck commented on code in PR #30032:
URL: https://github.com/apache/airflow/pull/30032#discussion_r1173868001


##########
tests/providers/amazon/aws/operators/test_redshift_cluster.py:
##########
@@ -115,6 +115,22 @@ def test_create_multi_node_cluster(self, mock_get_conn):
 
         # wait_for_completion is False so check waiter is not called
         mock_get_conn.return_value.get_waiter.assert_not_called()
+    
+    
@mock.patch("airflow.providers.amazon.aws.hooks.redshift_cluster.RedshiftHook.get_conn")
+    def test_create_cluster_deferrable(self, mock_get_conn):
+        redshift_operator = RedshiftCreateClusterOperator(
+            task_id="task_test",
+            cluster_identifier="test-cluster",
+            node_type="dc2.large",
+            master_username="adminuser",
+            master_user_password="Test123$",
+            cluster_type="single-node",
+            wait_for_completion=True,
+            deferrable=True,
+        )
+
+        with pytest.raises(TaskDeferred):
+            redshift_operator.execute(None)

Review Comment:
   Interesting. I was expecting to check that `self.defer` have been called, 
but this one works as well :)



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