Example #1
0
def test_get_active_assets_ensure_deps_loaded_first():
    # Ensure that assets that require dependencies have the deps
    # loaded FIRST.
    active_res = charts_builder.get_active_assets(['D3', 'C3'])
    assert active_res['css'][0].endswith('c3.min.css')
    assert active_res['js'][0].endswith('d3.min.js')
    # c3 depends on d3.
    assert active_res['js'][1].endswith('c3.min.js')
Example #2
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
Example #3
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
Example #4
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