Files
2026-09-19 12:54:45 +08:00

22 lines
599 B
Python

"""Tests for chart generation."""
from app.analysis.charts import boxplot, grouped_bar, heatmap
def test_heatmap_returns_base64():
data = {"m1": {"L1": 0.5, "L2": 0.8}}
b64 = heatmap(data, title="Test")
assert b64.startswith("iVBOR") or b64.startswith("/9j")
def test_boxplot_returns_base64():
data = {"m1-L1": [0.1, 0.2, 0.3]}
b64 = boxplot(data, title="Test")
assert isinstance(b64, str) and len(b64) > 0
def test_grouped_bar_returns_base64():
data = {"m1": {"L1": 0.5}}
b64 = grouped_bar(data, title="Test")
assert isinstance(b64, str) and len(b64) > 0