mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-24 18:50:15 +00:00
test: align csp test with pathlib rooting pattern from existing suite
Use Path(__file__).resolve().parents[1] so the test survives being run from a non-repo-root cwd, matching test_issue1112_csp_google_fonts.py.
This commit is contained in:
@@ -6,11 +6,13 @@ jsDelivr and are fetched via connect (not script load), so connect-src must
|
||||
include cdn.jsdelivr.net or browsers block the fetch and emit CSP violations.
|
||||
"""
|
||||
import re
|
||||
from pathlib import Path
|
||||
|
||||
_HELPERS_PY = Path(__file__).resolve().parents[1] / "api/helpers.py"
|
||||
|
||||
|
||||
def _helpers_src() -> str:
|
||||
with open("api/helpers.py") as f:
|
||||
return f.read()
|
||||
return _HELPERS_PY.read_text()
|
||||
|
||||
|
||||
class TestCSPConnectSrcJsdelivr:
|
||||
|
||||
Reference in New Issue
Block a user