forked from pyecharts/pyecharts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Page 中 js_host 与全局 CurrentConfig.ONLINE_HOST 表现不一致 (pyecharts#1150)
* Fix: Page 中 js_host 与全局 CurrentConfig.ONLINE_HOST 表现不一致 * Add: LabelOpts 新增 interval 参数 * Fix: test
- Loading branch information
1 parent
aff933e
commit acf9b10
Showing
4 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from nose.tools import eq_ | ||
|
||
from example.commons import Faker | ||
from pyecharts.charts import Bar, Line, Page | ||
|
||
|
||
def _create_bar() -> Bar: | ||
return Bar().add_xaxis(Faker.choose()).add_yaxis("商家A", Faker.values()) | ||
|
||
|
||
def _create_line() -> Line: | ||
return Line().add_xaxis(Faker.choose()).add_yaxis("商家A", Faker.values()) | ||
|
||
|
||
def test_page_jshost_default(): | ||
bar = _create_bar() | ||
line = _create_line() | ||
page = Page().add(bar, line) | ||
eq_(page.js_host, "https://assets.pyecharts.org/assets/") | ||
|
||
|
||
def test_page_jshost_custom(): | ||
from pyecharts.globals import CurrentConfig | ||
|
||
custom_host = "http://localhost:8888/assets/" | ||
CurrentConfig.ONLINE_HOST = custom_host | ||
bar = _create_bar() | ||
line = _create_line() | ||
page = Page().add(bar, line) | ||
eq_(page.js_host, custom_host) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters