Skip to content

Commit

Permalink
Adding test for single image
Browse files Browse the repository at this point in the history
  • Loading branch information
glenrobson committed May 23, 2024
1 parent 1d2ebf9 commit 5dbd43b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_manifests_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,30 @@ def test_v2_image_api(self):
self.assertEqual(image['@id'], "https://localhost/iiif/1991-12-compute-magazine$0/full/full/0/default.jpg", "Resource not using new image server")
self.assertEqual(image['service']['@id'], 'https://localhost/iiif/1991-12-compute-magazine$0', "V2 service not using the new image server")

def test_v2_single_image(self):
resp = self.test_app.get("/iiif/2/img-8664_202009/manifest.json")
self.assertEqual(resp.status_code, 200)
manifest = resp.json

self.assertEqual(manifest['@id'], 'https://localhost/iiif/img-8664_202009/manifest.json', 'V2 Manifest ID is using new infrastructure changed')
canvas = manifest['sequences'][0]['canvases'][0]
self.assertEqual(canvas['@id'], 'https://iiif.archivelab.org/iiif/img-8664_202009/canvas', 'Expected canvas id to be the same')
image = canvas['images'][0]['resource']
self.assertEqual(image['@id'], "https://localhost/iiif/img-8664_202009/full/full/0/default.jpg", "Resource not using new image server")
self.assertEqual(image['service']['@id'], 'https://localhost/iiif/img-8664_202009', "V2 service not using the new image server")

def test_v2_single_text_manifest(self):
resp = self.test_app.get("/iiif/2/fbf_3chords_1_/manifest.json")
self.assertEqual(resp.status_code, 200)
manifest = resp.json

self.assertEqual(manifest['@id'], 'https://localhost/iiif/fbf_3chords_1_/manifest.json', 'V2 Manifest ID is using new infrastructure changed')
canvas = manifest['sequences'][0]['canvases'][0]
self.assertEqual(canvas['@id'], 'https://iiif.archivelab.org/iiif/fbf_3chords_1_$0/canvas', 'Expected canvas id to be the same')
image = canvas['images'][0]['resource']
self.assertEqual(image['@id'], "https://localhost/iiif/fbf_3chords_1_$0/full/full/0/default.jpg", "Resource not using new image server")
self.assertEqual(image['service']['@id'], 'https://localhost/iiif/fbf_3chords_1_$0', "V2 service not using the new image server")


def test_text_which_is_image(self):
resp = self.test_app.get("/iiif/2/fbf_3chords_1_/manifest.json")
Expand Down

0 comments on commit 5dbd43b

Please sign in to comment.