Files
AzSuicideDataVisualization/.venv/Lib/site-packages/altair/vegalite/v4/tests/test_theme.py
2022-05-23 00:16:32 +04:00

20 lines
505 B
Python

import pytest
import altair.vegalite.v4 as alt
from altair.vegalite.v4.theme import VEGA_THEMES
@pytest.fixture
def chart():
return alt.Chart("data.csv").mark_bar().encode(x="x:Q")
def test_vega_themes(chart):
for theme in VEGA_THEMES:
with alt.themes.enable(theme):
dct = chart.to_dict()
assert dct["usermeta"] == {"embedOptions": {"theme": theme}}
assert dct["config"] == {
"view": {"continuousWidth": 400, "continuousHeight": 300}
}