示例#1
0
def test_pyecharts_remote_jshost():
    target_config = PyEchartsConfig(jshost=DEFAULT_JUPYTER_GITHUB_URL)
    eq_('https://chfw.github.io/jupyter-echarts/echarts', target_config.jshost)

    assert target_config.js_embed

    target_config.force_js_embed = True

    assert target_config.js_embed
示例#2
0
def test_custom_local_jshost():
    target_config = PyEchartsConfig(jshost="/static/js/")
    eq_("/static/js", target_config.jshost)

    assert not target_config.js_embed

    target_config.force_js_embed = True

    assert target_config.js_embed
示例#3
0
def test_custom_local_jshost():
    target_config = PyEchartsConfig(jshost='/static/js/')
    eq_('/static/js', target_config.jshost)

    assert not target_config.js_embed

    target_config.force_js_embed = True

    assert target_config.js_embed
示例#4
0
def test_with_default_value():
    target_config = PyEchartsConfig()
    eq_(SCRIPT_FILE_PATH, target_config.jshost)

    assert target_config.js_embed

    target_config.force_js_embed = True

    assert target_config.js_embed
示例#5
0
def test_custom_remote_jshost():
    target_config = PyEchartsConfig(
        jshost="https://cdn.bootcss.com/echarts/3.7.2/")
    eq_("https://cdn.bootcss.com/echarts/3.7.2", target_config.jshost)

    assert not target_config.js_embed

    target_config.force_js_embed = True

    assert target_config.js_embed
示例#6
0
def test_custom_remote_jshost():
    target_config = PyEchartsConfig(
        jshost='https://cdn.bootcss.com/echarts/3.7.2/')
    eq_('https://cdn.bootcss.com/echarts/3.7.2', target_config.jshost)

    assert not target_config.js_embed

    target_config.force_js_embed = True

    assert target_config.js_embed
示例#7
0
def test_custom_local_jshost():
    target_config = PyEchartsConfig(jshost='/static/js/')
    eq_('/static/js', target_config.jshost)
    eq_('/static/js', target_config.get_current_jshost_for_script())
    eq_('/static/js', target_config.get_current_jshost_for_jupyter())
    eq_('/static/js/echarts',
        target_config.get_current_jshost_for_jupyter('/static/js/echarts'))

    assert not target_config.js_embed

    target_config.force_js_embed = True

    assert target_config.js_embed
示例#8
0
def test_with_default_value():
    target_config = PyEchartsConfig()
    eq_(SCRIPT_LOCAL_JSHOST, target_config.jshost)
    eq_(SCRIPT_LOCAL_JSHOST, target_config.get_current_jshost_for_script())
    eq_(JUPYTER_LOCAL_JSHOST, target_config.get_current_jshost_for_jupyter())
    eq_('http://demo',
        target_config.get_current_jshost_for_script('http://demo'))

    assert target_config.js_embed

    target_config.force_js_embed = True

    assert target_config.js_embed
示例#9
0
def test_pyecharts_remote_jshost():
    target_config = PyEchartsConfig(jshost=DEFAULT_HOST)
    eq_('https://chfw.github.io/jupyter-echarts/echarts', target_config.jshost)
    eq_('https://chfw.github.io/jupyter-echarts/echarts',
        target_config.get_current_jshost_for_script())
    eq_('https://chfw.github.io/jupyter-echarts/echarts',
        target_config.get_current_jshost_for_jupyter())
    eq_('/static/js/echarts',
        target_config.get_current_jshost_for_jupyter('/static/js/echarts'))

    assert target_config.js_embed

    target_config.force_js_embed = True

    assert target_config.js_embed
示例#10
0
def test_custom_remote_jshost():
    target_config = PyEchartsConfig(
        jshost='https://cdn.bootcss.com/echarts/3.7.2/')
    eq_('https://cdn.bootcss.com/echarts/3.7.2', target_config.jshost)
    eq_('https://cdn.bootcss.com/echarts/3.7.2',
        target_config.get_current_jshost_for_script())
    eq_('https://cdn.bootcss.com/echarts/3.7.2',
        target_config.get_current_jshost_for_jupyter())
    eq_('/static/js/echarts',
        target_config.get_current_jshost_for_jupyter('/static/js/echarts'))

    assert not target_config.js_embed

    target_config.force_js_embed = True

    assert target_config.js_embed