mirror of
https://github.com/pyecharts/pyecharts.git
synced 2025-12-08 20:59:23 +00:00
update test code
This commit is contained in:
parent
fe656f0dda
commit
a87b4cedab
2
test.py
2
test.py
@ -1,4 +1,4 @@
|
||||
import os
|
||||
|
||||
os.system("nosetests --with-coverage --cover-package pyecharts --cover-package")
|
||||
os.system("nosetests --with-coverage --cover-package pyecharts --cover-package .")
|
||||
os.system("flake8 --exclude build --max-line-length 89 --ignore=F401")
|
||||
|
||||
@ -35,7 +35,5 @@ def test_render(fake_writer):
|
||||
|
||||
def test_base_iso_format():
|
||||
mock_time_str = "2022-04-14 14:42:00"
|
||||
assert (
|
||||
default(datetime.strptime(mock_time_str, "%Y-%m-%d %H:%M:%S"))
|
||||
== "2022-04-14T14:42:00"
|
||||
)
|
||||
mock_time = datetime.strptime(mock_time_str, "%Y-%m-%d %H:%M:%S")
|
||||
assert (default(mock_time) == "2022-04-14T14:42:00")
|
||||
|
||||
@ -98,4 +98,3 @@ def test_tree_map_item_style_options_remove_none():
|
||||
"borderWidth": 0,
|
||||
}
|
||||
assert_equal(expected, remove_key_with_none_value(option.opts))
|
||||
|
||||
|
||||
@ -19,7 +19,6 @@ def test_custom_base(fake_writer):
|
||||
var start = api.coord([api.value(1), categoryIndex]);
|
||||
var end = api.coord([api.value(2), categoryIndex]);
|
||||
var height = api.size([0, 1])[1] * 0.6;
|
||||
|
||||
var rectShape = echarts.graphic.clipRectByRect({
|
||||
x: start[0],
|
||||
y: start[1] - height / 2,
|
||||
@ -31,7 +30,6 @@ def test_custom_base(fake_writer):
|
||||
width: params.coordSys.width,
|
||||
height: params.coordSys.height
|
||||
});
|
||||
|
||||
return rectShape && {
|
||||
type: 'rect',
|
||||
shape: rectShape,
|
||||
|
||||
@ -9,7 +9,8 @@ from pyecharts.charts import Lines3D
|
||||
|
||||
@patch("pyecharts.render.engine.write_utf8_html_file")
|
||||
def test_lines3d_base(fake_writer):
|
||||
test_main_url: str = "https://cdn.jsdelivr.net/gh/apache/echarts-website@asf-site/examples"
|
||||
test_main_url: str = \
|
||||
"https://cdn.jsdelivr.net/gh/apache/echarts-website@asf-site/examples"
|
||||
data_json_url = test_main_url + "/data-gl/asset/data/flights.json"
|
||||
base_texture = test_main_url + "/data-gl/asset/world.topo.bathy.200401.jpg"
|
||||
height_texture = test_main_url + "/data-gl/asset/bathymetry_bw_composite_4k.jpg"
|
||||
|
||||
@ -24,4 +24,3 @@ def test_composite_mixin_len():
|
||||
c.add(b_1, "bar")
|
||||
c.add(b_2, "line")
|
||||
assert len(c) == 2
|
||||
|
||||
|
||||
@ -8,8 +8,12 @@ def test_utils_produce_require_dict():
|
||||
assert_equal(cfg["config_items"], ["'echarts':'https://example.comecharts.min'"])
|
||||
assert_equal(cfg["libraries"], ["'echarts'"])
|
||||
|
||||
cfg_1 = utils.produce_require_dict(utils.OrderedSet("https://api.map.baidu.com"), "https://example.com")
|
||||
assert_equal(cfg_1["config_items"], ["'baidu_map_api25':'https://api.map.baidu.com'"])
|
||||
cfg_1 = utils.produce_require_dict(
|
||||
utils.OrderedSet("https://api.map.baidu.com"), "https://example.com",
|
||||
)
|
||||
assert_equal(
|
||||
cfg_1["config_items"], ["'baidu_map_api25':'https://api.map.baidu.com'"],
|
||||
)
|
||||
assert_equal(cfg_1["libraries"], ["'baidu_map_api25'"])
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user