Fix dotted test

This commit is contained in:
Adam Hopkins 2022-07-28 10:07:30 +03:00
parent e54ac3c6fd
commit 7e0b0deb11
No known key found for this signature in database
GPG Key ID: 9F85EE6C807303FB

View File

@ -605,10 +605,10 @@ def test_dotted_dir_ok(
app: Sanic, static_file_directory: str, double_dotted_directory_file: Path app: Sanic, static_file_directory: str, double_dotted_directory_file: Path
): ):
app.static("/foo", static_file_directory) app.static("/foo", static_file_directory)
double_dotted_directory_file = str(double_dotted_directory_file).lstrip( dot_relative_path = str(
static_file_directory 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.status == 200
assert response.body == b"DOT\n" assert response.body == b"DOT\n"