Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hadro committed Jul 25, 2023
1 parent 39dff59 commit 543418c
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions tests/test_manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,41 @@ def test_v3_etree_mediatype(self):

self.assertEqual(len(manifest['items']),36,f"Expected 1 canvas but got: {len(manifest['items'])}")


def test_v3_64Kbps_MP3(self):
resp = self.test_app.get("/iiif/3/TvQuran.com__Alafasi/manifest.json")
self.assertEqual(resp.status_code, 200)
manifest = resp.json
self.assertEqual(len(manifest['items']),114,f"Expected 1 canvas but got: {len(manifest['items'])}")
self.assertEqual("64Kbps MP3".lower() in resp.text.lower(), True, f"Expected the string '64Kbps MP3'")


def test_v3_128Kbps_MP3(self):
resp = self.test_app.get("/iiif/3/alice_in_wonderland_librivox/manifest.json")
self.assertEqual(resp.status_code, 200)
manifest = resp.json
self.assertEqual(len(manifest['items']),12,f"Expected 1 canvas but got: {len(manifest['items'])}")
self.assertEqual("128kbps mp3".lower() in resp.text.lower(), True, f"Expected the string '128kbps mp3'")

def test_v3_h264_MPEG4_OGG_Theora(self):
resp = self.test_app.get("/iiif/3/taboca_201002_03/manifest.json")
self.assertEqual(resp.status_code, 200)
manifest = resp.json
self.assertEqual(len(manifest['items']),251,f"Expected 1 canvas but got: {len(manifest['items'])}")
self.assertEqual("h.264 MPEG4".lower() in resp.text.lower(), True, f"Expected the string 'h.264 MPEG4'")
self.assertEqual("OGG Theora".lower() in resp.text.lower(), True, f"Expected the string 'OGG Theora'")

def test_v3_aiff(self):
resp = self.test_app.get("/iiif/3/PDextend_AIFF/manifest.json")
self.assertEqual(resp.status_code, 200)
manifest = resp.json
self.assertEqual(len(manifest['items']),38,f"Expected 1 canvas but got: {len(manifest['items'])}")
self.assertEqual("AIFF".lower() in resp.text.lower(), True, f"Expected the string 'AIFF'")

''' to test:
TvQuran.com__Alafasi (64Kbps MP3)
alice_in_wonderland_librivox (128kbps mp3)
kaled_jalil (no derivatives)
taboca_201002_03 (h.264 MPEG4, OGG Theora)
Dokku_obrash (geo-restricted?)
m4a filetypes (No length to files?)
'''

if __name__ == '__main__':
Expand Down

0 comments on commit 543418c

Please sign in to comment.