Skip to content

Commit 0e2a700

Browse files
Copilotmsyyc
andauthored
[python] Add mock API tests for Azure/typespec-azure PR #4959 Spector scenarios (#11410)
Adds Python SDK mock API tests for new Spector scenarios introduced in [Azure/typespec-azure#4959](Azure/typespec-azure#4959). - Fixes #11409 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
1 parent 5ccc2fe commit 0e2a700

3 files changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
changeKind: internal
3+
packages:
4+
- "@typespec/http-client-python"
5+
---
6+
7+
Add mock API tests for new Spector scenarios: ARM operation templates (Legacy RoutedOperations, LRO on GET, POST LRO with paging body, POST action paging, markAsPageable) and `@clientApiVersions` decorator
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
# --------------------------------------------------------------------------
6+
import pytest
7+
import pytest_asyncio
8+
from azure.clientgenerator.core.apiversion.clientapiversions.aio import ClientApiVersionsClient
9+
10+
11+
@pytest_asyncio.fixture
12+
async def client():
13+
async with ClientApiVersionsClient(endpoint="http://localhost:3000", api_version="2022-10-01") as client:
14+
yield client
15+
16+
17+
@pytest.mark.asyncio
18+
async def test_send_api_version(client: ClientApiVersionsClient):
19+
await client.send_api_version()
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# -------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
# --------------------------------------------------------------------------
6+
import pytest
7+
from azure.clientgenerator.core.apiversion.clientapiversions import ClientApiVersionsClient
8+
9+
10+
@pytest.fixture
11+
def client():
12+
with ClientApiVersionsClient(endpoint="http://localhost:3000", api_version="2022-10-01") as client:
13+
yield client
14+
15+
16+
def test_send_api_version(client: ClientApiVersionsClient):
17+
client.send_api_version()

0 commit comments

Comments
 (0)