Resolve and caches paths for CachingStaticResource in the executor (#74474)
This commit is contained in:
parent
113ccfe6af
commit
332cf3cd2d
7 changed files with 69 additions and 21 deletions
|
@ -578,3 +578,35 @@ async def test_manifest_json(hass, frontend_themes, mock_http_client):
|
|||
|
||||
json = await resp.json()
|
||||
assert json["theme_color"] != DEFAULT_THEME_COLOR
|
||||
|
||||
|
||||
async def test_static_path_cache(hass, mock_http_client):
|
||||
"""Test static paths cache."""
|
||||
resp = await mock_http_client.get("/lovelace/default_view", allow_redirects=False)
|
||||
assert resp.status == 404
|
||||
|
||||
resp = await mock_http_client.get("/frontend_latest/", allow_redirects=False)
|
||||
assert resp.status == 403
|
||||
|
||||
resp = await mock_http_client.get(
|
||||
"/static/icons/favicon.ico", allow_redirects=False
|
||||
)
|
||||
assert resp.status == 200
|
||||
|
||||
# and again to make sure the cache works
|
||||
resp = await mock_http_client.get(
|
||||
"/static/icons/favicon.ico", allow_redirects=False
|
||||
)
|
||||
assert resp.status == 200
|
||||
|
||||
resp = await mock_http_client.get(
|
||||
"/static/fonts/roboto/Roboto-Bold.woff2", allow_redirects=False
|
||||
)
|
||||
assert resp.status == 200
|
||||
|
||||
resp = await mock_http_client.get("/static/does-not-exist", allow_redirects=False)
|
||||
assert resp.status == 404
|
||||
|
||||
# and again to make sure the cache works
|
||||
resp = await mock_http_client.get("/static/does-not-exist", allow_redirects=False)
|
||||
assert resp.status == 404
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue