Lee-W commented on code in PR #66160:
URL: https://github.com/apache/airflow/pull/66160#discussion_r3186602673


##########
task-sdk/tests/task_sdk/execution_time/test_context.py:
##########
@@ -1032,3 +1053,242 @@ def get_connection(self, conn_id):
 
             with pytest.raises(AirflowNotFoundException, match="isn't 
defined"):
                 _get_connection("nonexistent_conn")
+
+
+class TestTaskStateAccessor:
+    TI_ID = UUID("01900000-0000-0000-0000-000000000001")
+
+    def test_get_returns_value(self, mock_supervisor_comms):
+        mock_supervisor_comms.send.return_value = 
TaskStateResult(value="app_001")
+
+        result = TaskStateAccessor(ti_id=self.TI_ID).get("job_id")
+
+        assert result == "app_001"
+        
mock_supervisor_comms.send.assert_called_once_with(GetTaskState(ti_id=self.TI_ID,
 key="job_id"))

Review Comment:
   ```suggestion
           assert mock_supervisor_comms.send.mock_calls == 
[call(GetTaskState(ti_id=self.TI_ID, key="job_id")]
   ```
   
   not blocking. I like this syntax a lot.



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