diff --git a/tests/django_urls.py b/tests/django_urls.py index 157b9b17..a3eb628e 100644 --- a/tests/django_urls.py +++ b/tests/django_urls.py @@ -1,3 +1,4 @@ +# pragma: no cover from __future__ import annotations from django.urls import path diff --git a/tests/test_string_utils.py b/tests/test_string_utils.py index 28329768..80cb5f27 100644 --- a/tests/test_string_utils.py +++ b/tests/test_string_utils.py @@ -3,21 +3,25 @@ from servestatic.utils import ensure_leading_trailing_slash -class EnsureLeadingTrailingSlashTests: - def test_none(self): - assert ensure_leading_trailing_slash(None) == "/" +def test_none(self): + assert ensure_leading_trailing_slash(None) == "/" - def test_empty(self): - assert ensure_leading_trailing_slash("") == "/" - def test_slash(self): - assert ensure_leading_trailing_slash("/") == "/" +def test_empty(self): + assert ensure_leading_trailing_slash("") == "/" - def test_contents(self): - assert ensure_leading_trailing_slash("/foo/") == "/foo/" - def test_leading(self): - assert ensure_leading_trailing_slash("/foo") == "/foo" +def test_slash(self): + assert ensure_leading_trailing_slash("/") == "/" - def test_trailing(self): - assert ensure_leading_trailing_slash("foo/") == "/foo" + +def test_contents(self): + assert ensure_leading_trailing_slash("/foo/") == "/foo/" + + +def test_leading(self): + assert ensure_leading_trailing_slash("/foo") == "/foo" + + +def test_trailing(self): + assert ensure_leading_trailing_slash("foo/") == "/foo" diff --git a/tests/utils.py b/tests/utils.py index 3b8f8730..3666dfe4 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,3 +1,4 @@ +# pragma: no cover from __future__ import annotations import os