Subham-KRLX commented on code in PR #62241:
URL: https://github.com/apache/airflow/pull/62241#discussion_r2884590584
##########
providers/microsoft/azure/tests/unit/microsoft/azure/sensors/test_msgraph.py:
##########
@@ -141,3 +141,24 @@ def test_template_fields(self):
for template_field in MSGraphSensor.template_fields:
getattr(sensor, template_field)
+
+ def test_execute_complete_passes_timeout_to_defer(self):
+ from datetime import timedelta
+ from unittest.mock import Mock, patch
+
+ sensor = MSGraphSensor(
+ task_id="check_timeout",
+ conn_id="powerbi",
+ url="myorg/admin/workspaces/scanStatus/{scanId}",
+ timeout=10,
+ )
+
+ context = {"ti": Mock()}
+
+ with patch.object(sensor, "defer") as mock_defer:
+ sensor.execute_complete(
+ context=context, event={"status": "success", "response":
json.dumps({"status": "running"})}
+ )
+ mock_defer.assert_called_once()
+ call_kwargs = mock_defer.call_args.kwargs
Review Comment:
@dabla Addressed both using {} for context and inlined the assertion.
Imports moved to top-level, squashed into one commit.
--
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]