Exemple #1
0
def test_asset_with_deps():
    main = JsAsset('with-deps.js',
                   requires=['jquery', 'bootstrap'],
                   static='with-deps.js')
    assets = require_assets('with-deps.js')
    expected = possible_assets('jquery.js') + \
        possible_assets('bootstrap.css') + \
        possible_assets('bootstrap.js') + \
        [main]
    print(assets)
    print(expected)
    assert assets == expected
    Asset.clear_assets('with-deps.js', 'with-deps')
Exemple #2
0
def test_require_simple_library_by_bundle():
    assert require_assets('jquery') == possible_assets('jquery.js')
Exemple #3
0
def test_multiple_requires():
    assert require_assets('bootstrap', 'jquery') == \
        possible_assets('bootstrap.css') + \
        possible_assets('bootstrap.js') + \
        possible_assets('jquery.js')
Exemple #4
0
def test_require_bundled_library():
    assert require_assets('bootstrap') == possible_assets('bootstrap.css') + \
        possible_assets('bootstrap.js')