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


##########
tests/providers/amazon/aws/operators/test_rds.py:
##########
@@ -404,10 +383,37 @@ def test_delete_db_instance_snapshot(self):
             dag=self.dag,
         )
         _patch_hook_get_connection(instance_snapshot_operator.hook)
-        instance_snapshot_operator.execute(None)
+        with patch.object(instance_snapshot_operator.hook, 
"wait_for_db_snapshot_state") as mock_wait:
+            instance_snapshot_operator.execute(None)
+        mock_wait.assert_called_once_with(DB_INSTANCE_SNAPSHOT, 
target_state="deleted")
 
         with pytest.raises(self.hook.conn.exceptions.ClientError):
-            
self.hook.conn.describe_db_snapshots(DBSnapshotIdentifier=DB_CLUSTER_SNAPSHOT)
+            
self.hook.conn.describe_db_snapshots(DBSnapshotIdentifier=DB_INSTANCE_SNAPSHOT)

Review Comment:
   Fix: this method was checking the DB _cluster_ id when it should be checking 
for the DB _instance_ id. Neither resource exists, so in both cases a 
`ClientError` error is raised (would be best to check the "Code" property of 
the error, but that's out of the scope of this PR)



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