mirror of
https://github.com/pyecharts/pyecharts.git
synced 2026-02-01 17:46:01 +00:00
* update some config. * format code. * format code. * add test code. * add test and example. * format code. * A letter was deleted by mistake. * add a config parameter at liquid and update test code.
37 lines
946 B
Python
37 lines
946 B
Python
from unittest.mock import patch
|
|
|
|
from nose.tools import eq_
|
|
|
|
from pyecharts.charts import Tree
|
|
|
|
|
|
@patch("pyecharts.render.engine.write_utf8_html_file")
|
|
def test_tree_base(fake_writer):
|
|
data = [
|
|
{
|
|
"children": [
|
|
{"name": "B"},
|
|
{
|
|
"children": [
|
|
{"children": [{"name": "I"}], "name": "E"},
|
|
{"name": "F"},
|
|
],
|
|
"name": "C",
|
|
},
|
|
{
|
|
"children": [
|
|
{"children": [{"name": "J"}, {"name": "K"}], "name": "G"},
|
|
{"name": "H"},
|
|
],
|
|
"name": "D",
|
|
},
|
|
],
|
|
"name": "A",
|
|
}
|
|
]
|
|
c = Tree().add("", data)
|
|
c.render()
|
|
_, content = fake_writer.call_args[0]
|
|
eq_(c.theme, "white")
|
|
eq_(c.renderer, "canvas")
|