mirror of
https://github.com/dataforcanada/d4c-service-geo-assistant.git
synced 2026-06-13 14:31:01 +02:00
Enable pydocstyle (D) ruff rule and add more docs (#21)
* Use pydocstyle (D) rule with google convention Add a ruff rule to catch missing documentation. Using google convention so that undocumented-param (D417) rule is enabled to catch missing params, xref https://docs.astral.sh/ruff/rules/undocumented-param. Extended to include D213 (instead of D212) and D410 rules too. * Fix D100 Missing docstring in public module * Fix D101 Missing docstring in public class * Fix D103 Missing docstring in public function Also ignore rule D205 to allow first sentence of docstring to wrap to multiple lines. * Fix D417 Missing argument description in the docstring * Update indent in pyproject.toml file
This commit is contained in:
+4
-1
@@ -1,3 +1,5 @@
|
||||
"""Tests for chat API endpoint."""
|
||||
|
||||
from uuid import uuid4
|
||||
|
||||
import pytest
|
||||
@@ -10,7 +12,7 @@ from geo_assistant.api.app import app
|
||||
|
||||
@pytest_asyncio.fixture
|
||||
async def initialized_app():
|
||||
"""Initialize the app's chatbot before testing"""
|
||||
"""Initialize the app's chatbot before testing."""
|
||||
# Manually initialize the chatbot as the lifespan would
|
||||
app.state.chatbot = await create_graph()
|
||||
yield app
|
||||
@@ -21,6 +23,7 @@ async def initialized_app():
|
||||
|
||||
@pytest.mark.xfail
|
||||
async def test_call_api(initialized_app):
|
||||
"""Test calling the API at the /chat HTTP POST endpoint."""
|
||||
async with AsyncClient(
|
||||
transport=ASGITransport(app=initialized_app),
|
||||
base_url="http://test",
|
||||
|
||||
Reference in New Issue
Block a user