From 7fc14c07abd0e63e2056244335104889b72ffb2e Mon Sep 17 00:00:00 2001 From: Archmonger <16909269+Archmonger@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:02:47 -0700 Subject: [PATCH] Skip coverage of test util functions --- tests/django_urls.py | 1 + tests/test_string_utils.py | 30 +++++++++++++++++------------- tests/utils.py | 1 + 3 files changed, 19 insertions(+), 13 deletions(-) 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