forked from pyecharts/pyecharts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_parallel.py
More file actions
35 lines (31 loc) · 955 Bytes
/
test_parallel.py
File metadata and controls
35 lines (31 loc) · 955 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
28
29
30
31
32
33
34
35
from unittest.mock import patch
from nose.tools import assert_equal
from pyecharts.charts import Parallel
@patch("pyecharts.render.engine.write_utf8_html_file")
def test_parallel_base(fake_writer):
data = [
[1, 91, 45, 125, 0.82, 34],
[2, 65, 27, 78, 0.86, 45],
[3, 83, 60, 84, 1.09, 73],
[4, 109, 81, 121, 1.28, 68],
[5, 106, 77, 114, 1.07, 55],
[6, 109, 81, 121, 1.28, 68],
]
c = (
Parallel()
.add_schema(
[
{"dim": 0, "name": "data"},
{"dim": 1, "name": "AQI"},
{"dim": 2, "name": "PM2.5"},
{"dim": 3, "name": "PM10"},
{"dim": 4, "name": "CO"},
{"dim": 5, "name": "NO2"},
]
)
.add("parallel", data)
)
c.render()
_, content = fake_writer.call_args[0]
assert_equal(c.theme, "white")
assert_equal(c.renderer, "canvas")