SameerMesiah97 commented on code in PR #61951:
URL: https://github.com/apache/airflow/pull/61951#discussion_r2908075268
##########
providers/google/tests/unit/google/cloud/operators/test_dataproc.py:
##########
@@ -819,7 +819,7 @@ def test_execute(self, mock_hook, to_dict_mock):
# Test whether xcom push occurs before create cluster is called
self.extra_links_manager_mock.assert_has_calls(expected_calls,
any_order=False)
- to_dict_mock.assert_called_once_with(mock_hook().wait_for_operation())
+
to_dict_mock.assert_called_once_with(mock_hook.return_value.get_cluster.return_value)
if AIRFLOW_V_3_0_PLUS:
Review Comment:
I am a bit confused by this feedback. Are you referring to lines 823-832? I
do not believe I have touched those lines in this PR. And I am not sure if we
should remove the branching to deduplicate the code because one branch (which
has the duplicated assert) is for covering legacy behavior (you can tell by the
version check on line 823).
If you are referring to the `assert_called_once_with` invocations on line
816, 817 and 822, they are for different mock objects. `assert_has_calls` can't
be applied without altering the mocks themselves, which would not make sense
for this test.
--
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]