def test_file_not_in_manifest_dir(self, tmpdir): with open(str(tmpdir.join("manifest.json")), "w") as fp: fp.write("{}") manifest = static.ImmutableManifestFiles() manifest.add_manifest(str(tmpdir.join("manifest.json")), "/static/") assert not manifest("/foo/static/bar.css", "/static/bar.css")
def test_file_wrong_prefix(self, tmpdir): with open(str(tmpdir.join("manifest.json")), "w") as fp: fp.write('{"css/bar.css": "css/bar.hash.css"}') manifest = static.ImmutableManifestFiles() manifest.add_manifest(str(tmpdir.join("manifest.json")), "/static/") assert not manifest(str(tmpdir.join("css/bar.hash.css")), "/other/bar.hash.css")
def test_returns_nothing_when_no_manifests(self): manifest = static.ImmutableManifestFiles() assert not manifest("/foo/static/bar.css", "/static/bar.css")