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')
def test_require_simple_library_by_bundle(): assert require_assets('jquery') == possible_assets('jquery.js')
def test_multiple_requires(): assert require_assets('bootstrap', 'jquery') == \ possible_assets('bootstrap.css') + \ possible_assets('bootstrap.js') + \ possible_assets('jquery.js')
def test_require_bundled_library(): assert require_assets('bootstrap') == possible_assets('bootstrap.css') + \ possible_assets('bootstrap.js')