forked from pyecharts/pyecharts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_themeriver.py
More file actions
27 lines (23 loc) · 803 Bytes
/
Copy pathtest_themeriver.py
File metadata and controls
27 lines (23 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from unittest.mock import patch
from nose.tools import assert_equal
from pyecharts import options as opts
from pyecharts.charts import ThemeRiver
@patch("pyecharts.render.engine.write_utf8_html_file")
def test_themeriver_basefake_writer(fake_writer):
data = [
["2015/11/08", 10, "DQ"],
["2015/11/20", 30, "TY"],
["2015/11/08", 21, "SS"],
["2015/11/14", 7, "QG"],
["2015/11/22", 4, "SY"],
["2015/11/20", 26, "DD"],
]
c = ThemeRiver().add(
["DQ", "TY", "SS", "QG", "SY", "DD"],
data,
singleaxis_opts=opts.SingleAxisOpts(type_="time", pos_bottom="10%"),
)
c.render()
_, content = fake_writer.call_args[0]
assert_equal(c.theme, "white")
assert_equal(c.renderer, "canvas")