Skip to content

Commit

Permalink
Rename tests for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
provinzkraut committed Apr 10, 2024
1 parent 79c2ccc commit 1f61c4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions tests/unit/test_static_files/test_file_serving_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from litestar.types import FileSystemProtocol


def test_default_static_files_config(
def test_default_static_files_router(
tmpdir: Path,
) -> None:
path = tmpdir / "test.txt"
Expand All @@ -42,7 +42,7 @@ def setup_dirs(tmpdir: Path) -> tuple[Path, Path]:
return paths[0], paths[1]


def test_multiple_static_files_configs(setup_dirs: tuple[Path, Path]) -> None:
def test_multiple_static_files_routers(setup_dirs: tuple[Path, Path]) -> None:
root1, root2 = setup_dirs

with create_test_client(
Expand All @@ -60,7 +60,7 @@ def test_multiple_static_files_configs(setup_dirs: tuple[Path, Path]) -> None:
assert response.text == "content2"


def test_static_files_configs_with_mixed_file_systems(
def test_static_files_routers_with_mixed_file_systems(
file_system: FileSystemProtocol, setup_dirs: tuple[Path, Path]
) -> None:
root1, root2 = setup_dirs
Expand All @@ -80,7 +80,7 @@ def test_static_files_configs_with_mixed_file_systems(
assert response.text == "content2"


def test_static_files_config_with_multiple_directories(
def test_static_files_routers_with_multiple_directories(
file_system: FileSystemProtocol, setup_dirs: tuple[Path, Path]
) -> None:
root1, root2 = setup_dirs
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_static_files/test_static_files_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@


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


def test_config_validation_of_path(tmpdir: "Path") -> None:
def test_validation_of_path(tmpdir: "Path") -> None:
path = tmpdir / "text.txt"
path.write_text("content", "utf-8")

Expand All @@ -29,7 +29,7 @@ def test_config_validation_of_path(tmpdir: "Path") -> None:
create_static_files_router(path="/{param:int}", directories=[tmpdir])


def test_config_validation_of_file_system(tmpdir: "Path") -> None:
def test_validation_of_file_system(tmpdir: "Path") -> None:
class FSWithoutOpen:
def info(self) -> None:
return
Expand Down

0 comments on commit 1f61c4d

Please sign in to comment.