kaxil commented on code in PR #60651:
URL: https://github.com/apache/airflow/pull/60651#discussion_r2783237786
##########
providers/microsoft/winrm/tests/unit/microsoft/winrm/operators/test_winrm.py:
##########
@@ -104,3 +105,39 @@ def test_expected_return_code_command(self, mock_hook,
expected_return_code, rea
exception_msg = f"Error running cmd: {command}, return code:
{real_return_code}, error: KO"
with pytest.raises(AirflowException, match=exception_msg):
op.execute(None)
+
+ @mock.patch("airflow.providers.microsoft.winrm.operators.winrm.WinRMHook")
+ @mock.patch("airflow.providers.microsoft.winrm.triggers.winrm.WinRMHook")
+ def test_execute_deferrable_success(self, mock_operator_hook,
mock_trigger_hook):
+ mock_hook_instance = MagicMock()
Review Comment:
```suggestion
mock_hook_instance = MagicMock(spec=WinRMHook)
```
We should always use spec/autospec otherwise MagicMock will hide issues
--
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]