From ea283d3a6a9815c6fa360283cbc92479f40f32ab Mon Sep 17 00:00:00 2001 From: Nibbles Date: Thu, 21 May 2026 10:55:15 -0700 Subject: [PATCH 1/2] test: add unit test increasing coverage for cleanup.py --- tests/unittests/cli/utils/test_cleanup.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/unittests/cli/utils/test_cleanup.py diff --git a/tests/unittests/cli/utils/test_cleanup.py b/tests/unittests/cli/utils/test_cleanup.py new file mode 100644 index 0000000000..e5f5e9f3e8 --- /dev/null +++ b/tests/unittests/cli/utils/test_cleanup.py @@ -0,0 +1,15 @@ +from unittest.mock import AsyncMock, Mock + +import pytest + +from google.adk.cli.utils.cleanup import close_runners + + +@pytest.mark.asyncio +async def test_close_runners_calls_close(): + runner = Mock() + runner.close = AsyncMock() + + await close_runners([runner]) + + runner.close.assert_awaited_once() \ No newline at end of file From cc8aeaf43e9b0eaab09b3c9f08a00155619db7e6 Mon Sep 17 00:00:00 2001 From: cheesebee123 <122073817+cheesebee123@users.noreply.github.com> Date: Thu, 21 May 2026 12:03:19 -0700 Subject: [PATCH 2/2] Add copyright and license to test_cleanup.py Added copyright notice and licensing information. --- tests/unittests/cli/utils/test_cleanup.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/unittests/cli/utils/test_cleanup.py b/tests/unittests/cli/utils/test_cleanup.py index e5f5e9f3e8..ad94d20b2b 100644 --- a/tests/unittests/cli/utils/test_cleanup.py +++ b/tests/unittests/cli/utils/test_cleanup.py @@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from unittest.mock import AsyncMock, Mock import pytest @@ -12,4 +26,4 @@ async def test_close_runners_calls_close(): await close_runners([runner]) - runner.close.assert_awaited_once() \ No newline at end of file + runner.close.assert_awaited_once()