adf0d17497
publish / version_or_publish (push) Waiting to run
storybook-build / changes (push) Waiting to run
storybook-build / :storybook-build (push) Blocked by required conditions
Sync Gradio Skills to Hugging Face / sync-skills (push) Waiting to run
functional / changes (push) Waiting to run
functional / build-frontend (push) Blocked by required conditions
functional / functional-test-SSR=false (push) Blocked by required conditions
functional / functional-reload (push) Blocked by required conditions
functional / functional-test-SSR=true (push) Blocked by required conditions
hygiene / hygiene-test (push) Waiting to run
python / changes (push) Waiting to run
python / build (push) Blocked by required conditions
python / test-ubuntu-latest-flaky (push) Blocked by required conditions
python / test-ubuntu-latest-not-flaky (push) Blocked by required conditions
python / test-windows-latest-flaky (push) Blocked by required conditions
python / test-windows-latest-not-flaky (push) Blocked by required conditions
js / changes (push) Waiting to run
js / js-test (push) Blocked by required conditions
docs-build / changes (push) Waiting to run
docs-build / docs-build (push) Blocked by required conditions
docs-build / website-build (push) Blocked by required conditions
22 lines
814 B
Python
22 lines
814 B
Python
from gradio.themes.default import Default
|
|
from gradio.themes.utils.fonts import GoogleFont, LocalFont
|
|
|
|
|
|
def test_local_font_stylesheet_uses_bundled_static_path():
|
|
stylesheet = LocalFont("Lexend", weights=(400, 600)).stylesheet()
|
|
assert stylesheet["url"] is None
|
|
assert "static/fonts/Lexend/Lexend-Regular.woff2" in stylesheet["css"]
|
|
assert "static/fonts/Lexend/Lexend-SemiBold.woff2" in stylesheet["css"]
|
|
|
|
|
|
def test_google_font_falls_back_to_cdn_when_not_bundled():
|
|
stylesheet = GoogleFont("Nonexistent Font XYZ", weights=(400,)).stylesheet()
|
|
assert stylesheet["css"] is None
|
|
assert stylesheet["url"] is not None
|
|
assert "fonts.googleapis.com" in stylesheet["url"]
|
|
|
|
|
|
def test_default_theme_has_no_external_stylesheet_urls():
|
|
theme = Default()
|
|
assert theme._stylesheets == []
|