-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
210 additions
and
46 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
...ages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_core_scalar_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# ------------------------------------------------------------------------- | ||
# 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 specs.azure.core.scalar.aio import ScalarClient | ||
from specs.azure.core.scalar import models | ||
|
||
|
||
@pytest.fixture | ||
async def client(): | ||
async with ScalarClient() as client: | ||
yield client | ||
|
||
|
||
async def test_azure_location_scalar_get(client: ScalarClient): | ||
result = await client.azure_location_scalar.get() | ||
assert result == "eastus" | ||
|
||
|
||
async def test_azure_location_scalar_put(client: ScalarClient): | ||
await client.azure_location_scalar.put("eastus") | ||
|
||
|
||
async def test_azure_location_scalar_post(client: ScalarClient): | ||
result = await client.azure_location_scalar.post( | ||
models.AzureLocationModel(location="eastus") | ||
) | ||
assert result == models.AzureLocationModel(location="eastus") | ||
|
||
|
||
async def test_azure_location_scalar_header(client: ScalarClient): | ||
await client.azure_location_scalar.header(region="eastus") | ||
|
||
|
||
async def test_azure_location_scalar_query(client: ScalarClient): | ||
await client.azure_location_scalar.query(region="eastus") |
37 changes: 37 additions & 0 deletions
37
packages/typespec-python/test/azure/mock_api_tests/test_azure_core_scalar.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# ------------------------------------------------------------------------- | ||
# 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 specs.azure.core.scalar import ScalarClient, models | ||
|
||
|
||
@pytest.fixture | ||
def client(): | ||
with ScalarClient() as client: | ||
yield client | ||
|
||
|
||
def test_azure_location_scalar_get(client: ScalarClient): | ||
result = client.azure_location_scalar.get() | ||
assert result == "eastus" | ||
|
||
|
||
def test_azure_location_scalar_put(client: ScalarClient): | ||
client.azure_location_scalar.put("eastus") | ||
|
||
|
||
def test_azure_location_scalar_post(client: ScalarClient): | ||
result = client.azure_location_scalar.post( | ||
models.AzureLocationModel(location="eastus") | ||
) | ||
assert result == models.AzureLocationModel(location="eastus") | ||
|
||
|
||
def test_azure_location_scalar_header(client: ScalarClient): | ||
client.azure_location_scalar.header(region="eastus") | ||
|
||
|
||
def test_azure_location_scalar_query(client: ScalarClient): | ||
client.azure_location_scalar.query(region="eastus") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...c-python/test/generic_mock_api_tests/asynctests/test_server_endpoint_not_defined_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# ------------------------------------------------------------------------- | ||
# 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 server.endpoint.notdefined.aio import NotDefinedClient | ||
|
||
|
||
@pytest.fixture | ||
async def client(): | ||
async with NotDefinedClient(endpoint="http://localhost:3000") as client: | ||
yield client | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_valid(client: NotDefinedClient): | ||
assert await client.valid() is True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/typespec-python/test/generic_mock_api_tests/test_server_endpoint_not_defined.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# ------------------------------------------------------------------------- | ||
# 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 server.endpoint.notdefined import NotDefinedClient | ||
|
||
|
||
@pytest.fixture | ||
def client(): | ||
with NotDefinedClient(endpoint="http://localhost:3000") as client: | ||
yield client | ||
|
||
|
||
def test_valid(client: NotDefinedClient): | ||
assert client.valid() is True |
Oops, something went wrong.