pyecharts/test/test_table.py
陈键冬 755afe4893
Update: 调整 Table 样式以及新增 Typehint (#1109)
* Update: 调整 Table 样式以及新增 Typehint

* Fix: test

* Remove: setup.cfg
2019-05-13 23:01:40 +08:00

17 lines
484 B
Python

from unittest.mock import patch
from nose.tools import assert_in
from pyecharts.components import Table
@patch("pyecharts.render.engine.write_utf8_html_file")
def test_table_base(fake_writer):
table = Table()
headers = ["City name", "Area", "Population", "Annual Rainfall"]
rows = [["Brisbane", 5905, 1857594, 1146.4], ["Perth", 5386, 1554769, 869.4]]
table.add(headers, rows).render()
_, content = fake_writer.call_args[0]
assert_in("fl-table", content)