ferruzzi commented on code in PR #29822:
URL: https://github.com/apache/airflow/pull/29822#discussion_r1122320795


##########
tests/providers/amazon/aws/utils/test_waiter.py:
##########
@@ -38,6 +38,17 @@ def generate_response(state: str) -> dict[str, Any]:
     }
 
 
+def assert_expected_waiter_type(waiter: mock.MagicMock, expected: str):
+    """
+    There does not appear to be a straight-forward way to assert the type of 
waiter.
+    Instead, get the class name and check if it contains the expected name.
+
+    :param waiter: A mocked Boto3 Waiter object.
+    :param expected: The expected class name of the Waiter object, for example 
"ClusterActive".
+    """
+    assert expected in str(type(waiter.call_args[0][0]))

Review Comment:
   I'll add this check in the EMR hook unit tests, I think it's a good 
suggestion.  



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to