static_mounts mechanism works again, refs #272

This commit is contained in:
Simon Willison 2019-06-22 22:42:23 -07:00
commit eb06e59332
3 changed files with 15 additions and 2 deletions

View file

@ -8,6 +8,7 @@ from .fixtures import ( # noqa
METADATA,
)
import json
import pathlib
import pytest
import re
import urllib.parse
@ -52,6 +53,16 @@ def test_static(app_client):
assert "text/css" == response.headers["content-type"]
def test_static_mounts():
for client in make_app_client(
static_mounts=[("custom-static", str(pathlib.Path(__file__).parent))]
):
response = client.get("/custom-static/test_html.py")
assert response.status == 200
response = client.get("/custom-static/not_exists.py")
assert response.status == 404
def test_memory_database_page():
for client in make_app_client(memory=True):
response = client.get("/:memory:")