Skip to content
This repository was archived by the owner on May 22, 2026. It is now read-only.

Commit 4a5fd2e

Browse files
author
iscai-msft
committed
update mockapi tests
1 parent 2c9701e commit 4a5fd2e

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

packages/typespec-python/test/generic_mock_api_tests/asynctests/test_generation_subdir_async.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
# license information.
55
# --------------------------------------------------------------------------
66
import pytest
7-
from authentication.api.key.subdir.aio import CustomizedApiKeyClient
7+
from generation.subdir import CustomizedClient, Extension
88

99

1010
@pytest.mark.asyncio
11-
async def test_custom_method(key_credential):
12-
client = CustomizedApiKeyClient(key_credential("valid-key"))
13-
assert await client.custom_method()
11+
async def test_custom_method():
12+
client = CustomizedClient()
13+
assert (await client.custom_method()) == Extension(
14+
{
15+
"level": 0,
16+
"extension": [{"level": 1, "extension": [{"level": 2}]}, {"level": 1}],
17+
}
18+
)

packages/typespec-python/test/generic_mock_api_tests/test_generation_subdir.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,14 @@
33
# Licensed under the MIT License. See License.txt in the project root for
44
# license information.
55
# --------------------------------------------------------------------------
6-
import pytest
7-
from generation.subdir import CustomizedApiKeyClient
6+
from generation.subdir import CustomizedClient, Extension
87

98

10-
def test_custom_method(key_credential):
11-
client = CustomizedApiKeyClient(key_credential("valid-key"))
12-
assert client.custom_method()
13-
14-
15-
def test_custom_model():
16-
try:
17-
from authentication.api.key.subdir import InvalidAuth
18-
19-
assert InvalidAuth is not None
20-
except ImportError:
21-
pytest.fail("InvalidAuth could not be imported")
9+
def test_custom_method():
10+
client = CustomizedClient()
11+
assert client.custom_method() == Extension(
12+
{
13+
"level": 0,
14+
"extension": [{"level": 1, "extension": [{"level": 2}]}, {"level": 1}],
15+
}
16+
)

0 commit comments

Comments
 (0)