Skip to content

Commit

Permalink
Clean up and clear caches for tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
markpbaggett committed Feb 21, 2025
1 parent 5d6e6c1 commit 0e01aee
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion iiify/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def manifest2(identifier):
identifier, page = identifier.split('$')
page = int(page)
try:
return ldjsonify(create_manifest(identifier, domain=domain, page=page, version='2/'))
return ldjsonify(create_manifest(identifier, domain=domain, page=page))
except Exception as excpt:
print("Exception occurred in manifest2:")
print(excpt)
Expand Down
4 changes: 2 additions & 2 deletions iiify/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,14 @@ def manifest_page(identifier, label='', page='', width='', height='', metadata=N
}


def create_manifest(identifier, domain=None, page=None, version=""):
def create_manifest(identifier, domain=None, page=None):
path = os.path.join(media_root, identifier)
resp = requests.get('%s/metadata/%s' % (ARCHIVE, identifier)).json()
metadata = resp.get("metadata", {})

manifest = {
'@context': PRZ_CTX,
'@id': '%s%s%s/manifest.json' % (domain, version, identifier),
'@id': '%s2/%s/manifest.json' % (domain,identifier),
'@type': 'sc:Manifest',
'description': metadata.get('description', ''),
'logo': 'https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcReMN4l9cgu_qb1OwflFeyfHcjp8aUfVNSJ9ynk2IfuHwW1I4mDSw',
Expand Down
3 changes: 1 addition & 2 deletions tests/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class TestCollections(unittest.TestCase):

def setUp(self) -> None:
os.environ["FLASK_ENV"] = "testing"
os.environ["FLASK_CACHE_DISABLE"] = "true"
self.test_app = FlaskClient(app)

def test_v3_collection(self):
Expand All @@ -24,7 +24,6 @@ def test_v3_collection_pages(self):

def test_collections_proxy(self):
resp = self.test_app.get("/iiif/frankbford/collection.json")
print(resp.status_code)
self.assertEqual(resp.status_code, 200)

def test_v3_collection_pages_proxy(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class TestImages(unittest.TestCase):

def setUp(self) -> None:
os.environ["FLASK_ENV"] = "testing"
os.environ["FLASK_CACHE_DISABLE"] = "true"
self.test_app = FlaskClient(app)

def test_v3_resolving(self):
Expand Down

0 comments on commit 0e01aee

Please sign in to comment.