Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pratapvardhan committed Dec 20, 2024
1 parent 4c2912d commit 59e1bf2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/titiler/core/tests/test_case_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ def app():
app.add_middleware(LowerCaseQueryStringMiddleware)
return app


@pytest.fixture
def client(app):
"""Create test client."""
return TestClient(app)


def test_lowercase_middleware(app, client):
"""Make sure upper and lower case QS are accepted."""

@app.get("/route1")
async def route1(value: Annotated[str, Query()]):
"""route1."""
Expand All @@ -35,8 +38,10 @@ async def route1(value: Annotated[str, Query()]):
response = client.get("/route1?VALUE=lorenzori")
assert response.json() == {"value": "lorenzori"}


def test_lowercase_middleware_multiple_values(app, client):
"""Make sure all values are available for lists."""

@app.get("/route1")
async def route1(value: Annotated[List[str], Query()]):
"""route1."""
Expand All @@ -48,8 +53,10 @@ async def route1(value: Annotated[List[str], Query()]):
response = client.get("/route1?VALUE=lorenzori&VALUE=dogs&value=trucks")
assert response.json() == {"value": ["lorenzori", "dogs", "trucks"]}


def test_lowercase_middleware_url_with_query_parameters(app, client):
"""Make sure all query parameters return."""

@app.get("/route1")
async def route1(url: List[str] = Query(...)):
"""route1."""
Expand Down

0 comments on commit 59e1bf2

Please sign in to comment.