update test code

This commit is contained in:
sunhailinLeo 2023-03-16 11:37:38 +08:00
parent fe656f0dda
commit a87b4cedab
7 changed files with 11 additions and 12 deletions

View File

@ -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")

View File

@ -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")

View File

@ -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))

View File

@ -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,

View File

@ -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"

View File

@ -24,4 +24,3 @@ def test_composite_mixin_len():
c.add(b_1, "bar")
c.add(b_2, "line")
assert len(c) == 2

View File

@ -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'"])