Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@typespec/http-client-python"
---

Add mock api test for azure client-generator-core response-as-bool spector case
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export interface BuildTaskGroupsOptions {
export const SKIP_SPECS: string[] = [
"type/file",
"service/multiple-services",
"azure/client-generator-core/response-as-bool",
];

export const SpecialFlags: Record<string, Record<string, any>> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -------------------------------------------------------------------------
# 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 specs.azure.clientgenerator.core.responseasbool.aio import ResponseAsBoolClient


@pytest_asyncio.fixture
async def client():
async with ResponseAsBoolClient() as client:
yield client


@pytest.mark.asyncio
async def test_exists(client: ResponseAsBoolClient):
assert await client.head_as_boolean.exists() is True


@pytest.mark.asyncio
async def test_not_exists(client: ResponseAsBoolClient):
assert await client.head_as_boolean.not_exists() is False
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -------------------------------------------------------------------------
# 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.clientgenerator.core.responseasbool import ResponseAsBoolClient


@pytest.fixture
def client():
with ResponseAsBoolClient() as client:
yield client


def test_exists(client: ResponseAsBoolClient):
assert client.head_as_boolean.exists() is True


def test_not_exists(client: ResponseAsBoolClient):
assert client.head_as_boolean.not_exists() is False
Loading