Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/unittests/code_executors/test_gke_code_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ def mock_k8s_clients():
"google.adk.code_executors.gke_code_executor.client"
) as mock_client_class:
mock_batch_v1 = MagicMock(spec=client.BatchV1Api)
# The created Job becomes the ConfigMap's owner, so it needs the string
# fields a real API response has. kubernetes>=37 validates them.
mock_batch_v1.create_namespaced_job.return_value = client.V1Job(
api_version="batch/v1",
kind="Job",
metadata=client.V1ObjectMeta(name="test-job", uid="test-uid"),
)
mock_core_v1 = MagicMock(spec=client.CoreV1Api)
mock_client_class.BatchV1Api.return_value = mock_batch_v1
mock_client_class.CoreV1Api.return_value = mock_core_v1
Expand Down
Loading