From 9e740b61d3e00389b1de5b9807ad7d379888d941 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Jun 2026 09:00:26 +0000 Subject: [PATCH 1/2] Remove multiple-services from Python regenerate skip list Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- packages/http-client-python/eng/scripts/ci/regenerate-common.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/http-client-python/eng/scripts/ci/regenerate-common.ts b/packages/http-client-python/eng/scripts/ci/regenerate-common.ts index 1fe6f17d63c..61fda712aeb 100644 --- a/packages/http-client-python/eng/scripts/ci/regenerate-common.ts +++ b/packages/http-client-python/eng/scripts/ci/regenerate-common.ts @@ -72,7 +72,6 @@ export interface BuildTaskGroupsOptions { export const SKIP_SPECS: string[] = [ "type/file", - "service/multiple-services", "azure/client-generator-core/response-as-bool", ]; From 4e8e887957d4b3662eba304df8824f2436e7270e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Jun 2026 09:02:12 +0000 Subject: [PATCH 2/2] Add python mock_api tests for service/multiple-services Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- ...ltiple-services-tests-2026-6-10-8-56-11.md | 7 ++++ .../test_service_multiple_services_async.py | 41 +++++++++++++++++++ .../azure/test_service_multiple_services.py | 36 ++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 .chronus/changes/add-python-multiple-services-tests-2026-6-10-8-56-11.md create mode 100644 packages/http-client-python/tests/mock_api/azure/asynctests/test_service_multiple_services_async.py create mode 100644 packages/http-client-python/tests/mock_api/azure/test_service_multiple_services.py diff --git a/.chronus/changes/add-python-multiple-services-tests-2026-6-10-8-56-11.md b/.chronus/changes/add-python-multiple-services-tests-2026-6-10-8-56-11.md new file mode 100644 index 00000000000..14c091683a4 --- /dev/null +++ b/.chronus/changes/add-python-multiple-services-tests-2026-6-10-8-56-11.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/http-client-python" +--- + +Add sync and async mock_api tests for the `service/multiple-services` Spector scenario and enable its regeneration. diff --git a/packages/http-client-python/tests/mock_api/azure/asynctests/test_service_multiple_services_async.py b/packages/http-client-python/tests/mock_api/azure/asynctests/test_service_multiple_services_async.py new file mode 100644 index 00000000000..df3a090325c --- /dev/null +++ b/packages/http-client-python/tests/mock_api/azure/asynctests/test_service_multiple_services_async.py @@ -0,0 +1,41 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import pytest +import pytest_asyncio +from service.multipleservices.servicea.aio import ServiceAClient +from service.multipleservices.serviceb.aio import ServiceBClient + + +@pytest_asyncio.fixture +async def client_a(): + async with ServiceAClient() as client: + yield client + + +@pytest_asyncio.fixture +async def client_b(): + async with ServiceBClient() as client: + yield client + + +@pytest.mark.asyncio +async def test_service_a_op(client_a: ServiceAClient): + await client_a.operations.op_a() + + +@pytest.mark.asyncio +async def test_service_a_sub_namespace_op(client_a: ServiceAClient): + await client_a.sub_namespace.sub_op_a() + + +@pytest.mark.asyncio +async def test_service_b_op(client_b: ServiceBClient): + await client_b.operations.op_b() + + +@pytest.mark.asyncio +async def test_service_b_sub_namespace_op(client_b: ServiceBClient): + await client_b.sub_namespace.sub_op_b() diff --git a/packages/http-client-python/tests/mock_api/azure/test_service_multiple_services.py b/packages/http-client-python/tests/mock_api/azure/test_service_multiple_services.py new file mode 100644 index 00000000000..1949fba529c --- /dev/null +++ b/packages/http-client-python/tests/mock_api/azure/test_service_multiple_services.py @@ -0,0 +1,36 @@ +# ------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +import pytest +from service.multipleservices.servicea import ServiceAClient +from service.multipleservices.serviceb import ServiceBClient + + +@pytest.fixture +def client_a(): + with ServiceAClient() as client: + yield client + + +@pytest.fixture +def client_b(): + with ServiceBClient() as client: + yield client + + +def test_service_a_op(client_a: ServiceAClient): + client_a.operations.op_a() + + +def test_service_a_sub_namespace_op(client_a: ServiceAClient): + client_a.sub_namespace.sub_op_a() + + +def test_service_b_op(client_b: ServiceBClient): + client_b.operations.op_b() + + +def test_service_b_sub_namespace_op(client_b: ServiceBClient): + client_b.sub_namespace.sub_op_b()