diff --git a/tests/mock_server/server.py b/tests/mock_server/server.py index 9e5bea05..4283574f 100644 --- a/tests/mock_server/server.py +++ b/tests/mock_server/server.py @@ -1,4 +1,3 @@ -from os.path import abspath from os import getcwd from pathlib import Path @@ -10,20 +9,20 @@ def index(): @route("/static/") def static_path(filename): - template_path = abspath(getcwd()) / Path("tests/mock_server/templates") + template_path = Path.cwd().resolve() / "tests/mock_server/templates" response = static_file(filename, root=template_path) return response @route("/static_no_content_type/") def static_no_content_type(filename): - template_path = abspath(getcwd()) / Path("tests/mock_server/templates") + template_path = Path.cwd().resolve() / "tests/mock_server/templates" response = static_file(filename, root=template_path) response.set_header("Content-Type", "") return response @route("/static/headers/") def static_path_with_headers(filename): - template_path = abspath(getcwd()) / Path("tests/mock_server/templates") + template_path = Path.cwd().resolve() / "tests/mock_server/templates" response = static_file(filename, root=template_path) response.add_header("Content-Language", "en") response.add_header("Content-Script-Type", "text/javascript") @@ -32,7 +31,7 @@ def static_path_with_headers(filename): @route("/static/400/", method="HEAD") def static_400(filename): - template_path = abspath(getcwd()) / Path("tests/mock_server/templates") + template_path = Path.cwd().resolve() / "tests/mock_server/templates" response = static_file(filename, root=template_path) response.status = 400 response.add_header("Status-Code", "400") @@ -40,7 +39,7 @@ def static_400(filename): @route("/static/400/", method="GET") def static_200(filename): - template_path = abspath(getcwd()) / Path("tests/mock_server/templates") + template_path = Path.cwd().resolve() / "tests/mock_server/templates" response = static_file(filename, root=template_path) response.add_header("Status-Code", "200") return response