seanghaeli commented on code in PR #74125:
URL: https://github.com/apache/airflow/pull/74125#discussion_r4190064051


##########
providers/amazon/tests/unit/amazon/aws/waiters/test_comprehend.py:
##########
@@ -102,3 +103,38 @@ def test_create_document_classifier_wait(self, 
mock_describe_document_classifier
         ComprehendHook().get_waiter(self.WAITER_NAME).wait(
             DocumentClassifierArn="arn", WaiterConfig={"Delay": 0.01, 
"MaxAttempts": 3}
         )
+
+
+class 
TestComprehendDocumentClassifierDeletableWaiter(TestComprehendCustomWaitersBase):
+    WAITER_NAME = "document_classifier_deletable"
+
+    @pytest.fixture
+    def mock_describe_document_classifier(self):
+        with mock.patch.object(self.client, "describe_document_classifier") as 
mock_getter:
+            yield mock_getter
+
+    @pytest.mark.parametrize("state", ["TRAINED", "TRAINED_WITH_WARNING", 
"IN_ERROR", "STOPPED"])
+    def test_document_classifier_deletable(self, state, 
mock_describe_document_classifier):
+        mock_describe_document_classifier.return_value = 
{"DocumentClassifierProperties": {"Status": state}}
+
+        
ComprehendHook().get_waiter(self.WAITER_NAME).wait(DocumentClassifierArn="arn")
+

Review Comment:
   Adding onto this, I'd also assert `assert 
mock_describe_document_classifier.call_count == 2` in the retries test below. 
Currently if `SUBMITTED` gets flipped to `failure` the test would still pass 
erroneously. Adding this assert would prevent that



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