From 7e0b0deb11e73afb9807d1a5784772d9cfd92288 Mon Sep 17 00:00:00 2001 From: Adam Hopkins Date: Thu, 28 Jul 2022 10:07:30 +0300 Subject: [PATCH] Fix dotted test --- tests/test_static.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_static.py b/tests/test_static.py index fd33ee03..aeb625b7 100644 --- a/tests/test_static.py +++ b/tests/test_static.py @@ -605,10 +605,10 @@ def test_dotted_dir_ok( app: Sanic, static_file_directory: str, double_dotted_directory_file: Path ): app.static("/foo", static_file_directory) - double_dotted_directory_file = str(double_dotted_directory_file).lstrip( - static_file_directory + dot_relative_path = str( + double_dotted_directory_file.relative_to(static_file_directory) ) - _, response = app.test_client.get("/foo/" + double_dotted_directory_file) + _, response = app.test_client.get("/foo/" + dot_relative_path) assert response.status == 200 assert response.body == b"DOT\n"