def test_collect_static_asset(): """Collect static files and stash them with MD5 sums.""" c = Configurator() sap = DefaultStaticAssetPolicy(c) sap.add_static_view("websauna-static", "websauna.system:static") collected = sap.collect_static() # Check one resource from the collectin to see we succeeded assert collected["websauna-static"]["pyramid-32x32.png"] == 'perma-asset/pyramid-32x32.c453183eee6627ff09e49f0384cededd.png'
def test_collect_recurse(): """Check another more complicated static file folder collect""" c = Configurator() sap = DefaultStaticAssetPolicy(c) sap.add_static_view("deform-static", "deform:static") collected = sap.collect_static() assert len(collected) > 0 # Check one resource from the collectin to see we succeeded assert collected["deform-static"]["pickadate/translations/ja_JP.js"].startswith( 'perma-asset/pickadate/translations/ja_JP.')