ashb commented on code in PR #54083:
URL: https://github.com/apache/airflow/pull/54083#discussion_r2253896206
##########
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/hooks/test_kubernetes.py:
##########
@@ -437,11 +439,12 @@ def test_prefixed_names_still_work(self, mock_get_client):
mock_get_client.assert_called_with(cluster_context="test")
assert kubernetes_hook.get_namespace() == "test"
- def test_missing_default_connection_is_ok(self, remove_default_conn):
+ def test_missing_default_connection_is_ok(self, remove_default_conn,
mock_supervisor_comms):
# prove to ourselves that the default conn doesn't exist
k8s_conn_exists =
os.environ.get(f"AIRFLOW_CONN_{DEFAULT_CONN_ID.upper()}")
assert k8s_conn_exists is None
+ mock_supervisor_comms.send.side_effect =
[ErrorResponse(error=ErrorType.CONNECTION_NOT_FOUND)] * 2
Review Comment:
This will do for now, but I don't love this pattern of blindly mocking the
return value -- we should think about a better pattern for this sort of thing
in the future.
--
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]