diff --git a/.github/workflows/quality-checks.yml b/.github/workflows/quality-checks.yml index 2eac29b..d8900cc 100644 --- a/.github/workflows/quality-checks.yml +++ b/.github/workflows/quality-checks.yml @@ -28,4 +28,5 @@ jobs: run: | uv sync --all-extras --dev source .venv/bin/activate - uv run pytest tests/ \ No newline at end of file + uv run pytest tests/sync_tests --cov + uv run pytest tests/async_tests --cov \ No newline at end of file diff --git a/tests/async_tests/test_project.py b/tests/async_tests/test_project.py index b41b02f..e405da0 100644 --- a/tests/async_tests/test_project.py +++ b/tests/async_tests/test_project.py @@ -1,5 +1,5 @@ import pytest -import pytest_asyncio +import pytest_asyncio # noqa: F401 import httpx from munch import Munch from asyncmock import AsyncMock @@ -29,7 +29,7 @@ async def test_list_projects_success(client, mocker: AsyncMock): # noqa: F811 @pytest.mark.asyncio -async def test_create_project_success(client, mocker: AsyncMock): +async def test_create_project_success(client, mocker: AsyncMock): # noqa: F811 mock_post = mocker.patch("httpx.AsyncClient.post") mock_post.return_value = httpx.Response( @@ -49,9 +49,10 @@ async def test_create_project_success(client, mocker: AsyncMock): assert isinstance(response, Munch) assert response["metadata"]["guid"] == "mock_project_guid" - + + @pytest.mark.asyncio -async def test_get_project_success(client, mocker: AsyncMock): +async def test_get_project_success(client, mocker: AsyncMock): # noqa: F811 mock_get = mocker.patch("httpx.AsyncClient.get") mock_get.return_value = httpx.Response( @@ -59,16 +60,17 @@ async def test_get_project_success(client, mocker: AsyncMock): json={ "kind": "Project", "metadata": {"name": "test-project", "guid": "mock_project_guid"}, - } + }, ) - + response = await client.get_project("mock_project_guid") - + assert isinstance(response, Munch) assert response["metadata"]["guid"] == "mock_project_guid" - + + @pytest.mark.asyncio -async def test_update_project_success(client, mocker: AsyncMock): +async def test_update_project_success(client, mocker: AsyncMock): # noqa: F811 mock_put = mocker.patch("httpx.AsyncClient.put") mock_put.return_value = httpx.Response( @@ -76,24 +78,22 @@ async def test_update_project_success(client, mocker: AsyncMock): json={ "kind": "Project", "metadata": {"name": "test-project", "guid": "mock_project_guid"}, - } + }, ) - + response = await client.update_project("mock_project_guid", project_body) - + assert isinstance(response, Munch) assert response["metadata"]["guid"] == "mock_project_guid" - + + @pytest.mark.asyncio -async def test_delete_project_success(client, mocker: AsyncMock): +async def test_delete_project_success(client, mocker: AsyncMock): # noqa: F811 mock_delete = mocker.patch("httpx.AsyncClient.delete") - mock_delete.return_value = httpx.Response( - status_code=200, - json={"success": True} - ) - + mock_delete.return_value = httpx.Response(status_code=200, json={"success": True}) + response = await client.delete_project("mock_project_guid") - + assert isinstance(response, Munch) assert response["success"] is True