Exemplo n.º 1
0
def test_get_all_assets():
    res = charts_builder.get_all_assets()
    assert isinstance(res['css'], list)
    assert isinstance(res['js'], list)
    for url in res['js']:
        assert isinstance(url, str)
        assert url.endswith('.js')
    for url in res['css']:
        assert isinstance(url, str)
        assert url.endswith('.css')
Exemplo n.º 2
0
def test_get_all_assets():
    # Test that all assets are simply the right filetype and that they exist.
    res = charts_builder.get_all_assets()
    assert isinstance(res['css'], list)
    assert isinstance(res['js'], list)
    for url in res['js']:
        assert isinstance(url, str)
        assert url.endswith('.js')
    for url in res['css']:
        assert isinstance(url, str)
        assert url.endswith('.css')
Exemplo n.º 3
0
def test_get_active_assets_ensure_no_duplicates():
    all_res = charts_builder.get_all_assets()
    families = ['D3', 'D3', 'C3', 'C3']
    active_res = charts_builder.get_active_assets(families)
    assert all_res != active_res
Exemplo n.º 4
0
def test_get_active_assets():
    all_res = charts_builder.get_all_assets()
    families = ['D3']
    active_res = charts_builder.get_active_assets(families)
    assert all_res != active_res
Exemplo n.º 5
0
def test_get_active_assets_empty():
    all_res = charts_builder.get_all_assets()
    active_res = charts_builder.get_active_assets([])
    assert all_res == active_res