Files
altium-render-engine/backend/tests/test_fonts.py
T
nearology 56c5ee23d3
Verify / test (push) Failing after 2m54s
first commit
2026-11-05 17:31:17 +03:30

13 خطوط
583 B
Python

import json
from pathlib import Path
import pytest
from app.fonts import fonts,stylesheet
def test_font_manifest_only_allows_explicit_local_paths(tmp_path,monkeypatch):
monkeypatch.setenv('FONT_DIR',str(tmp_path)); (tmp_path/'test.woff2').write_bytes(b'font fixture')
(tmp_path/'fonts.json').write_text(json.dumps({'Arial':[{'file':'test.woff2','weight':'bold','style':'italic'}]}))
assert len(fonts())==1 and "font-weight:bold" in stylesheet()
(tmp_path/'fonts.json').write_text(json.dumps({'Arial':'../outside.woff2'}))
with pytest.raises(ValueError):fonts()