Skip to content

Commit

Permalink
refactor!: Remove deprecated StaticFileConfig (#3357)
Browse files Browse the repository at this point in the history
* Remove deprecated StaticFiles and StaticFilesConfig
* remove special casing of static files app from handlers/router
* remove outdated docs sections
* Add what's new section
* Rename tests for consistency
  • Loading branch information
provinzkraut committed Dec 12, 2024
1 parent 4527216 commit b9e943a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions litestar/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
)
from litestar.plugins.base import CLIPlugin
from litestar.router import Router
from litestar.routes import ASGIRoute, HTTPRoute, WebSocketRoute
from litestar.stores.registry import StoreRegistry
from litestar.types import Empty, TypeDecodersSequence
from litestar.types.internal_types import PathParameterDefinition, TemplateConfigType
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/test_static_files/test_static_files_validation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pathlib import Path
from typing import List

import pytest

Expand All @@ -9,7 +10,8 @@
from litestar.testing import create_test_client


def test_validation_of_directories() -> None:
@pytest.mark.parametrize("directories", [[], [""]])
def test_validation_of_directories(directories: List[str]) -> None:
with pytest.raises(ImproperlyConfiguredException):
create_static_files_router(path="/static", directories=[])

Expand Down

0 comments on commit b9e943a

Please sign in to comment.