This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(logging): improve dev logging experience
- cap log fixture no longer autouse, allows for rich formatting via pytest - create integration test client fixture that uses asgi lifespan closes #107 closes #120
- Loading branch information
1 parent
1a9e01d
commit fc04a99
Showing
5 changed files
with
56 additions
and
29 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,19 +1,17 @@ | ||
"""Integration tests for the test Author domain.""" | ||
from typing import TYPE_CHECKING | ||
from __future__ import annotations | ||
|
||
from httpx import AsyncClient | ||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from starlite import Starlite | ||
from httpx import AsyncClient | ||
|
||
|
||
async def test_update_author(app: "Starlite") -> None: | ||
async def test_update_author(client: AsyncClient) -> None: | ||
"""Integration test for PUT route.""" | ||
|
||
async with AsyncClient(app=app, base_url="http://testserver") as client: | ||
response = await client.put( | ||
"/authors/97108ac1-ffcb-411d-8b1e-d9183399f63b", | ||
json={"name": "TEST UPDATE", "dob": "1890-9-15"}, | ||
) | ||
assert response.status_code == 200 | ||
assert response.json()["name"] == "TEST UPDATE" | ||
response = await client.put( | ||
"/authors/97108ac1-ffcb-411d-8b1e-d9183399f63b", | ||
json={"name": "TEST UPDATE", "dob": "1890-9-15"}, | ||
) | ||
assert response.status_code == 200 | ||
assert response.json()["name"] == "TEST UPDATE" |