From 543418c2a3637b2d8f0fc354ed20b4af9117cff1 Mon Sep 17 00:00:00 2001 From: Josh Hadro Date: Tue, 25 Jul 2023 13:33:52 -0400 Subject: [PATCH] Add tests --- tests/test_manifests.py | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/tests/test_manifests.py b/tests/test_manifests.py index b4d44da..f3a282c 100644 --- a/tests/test_manifests.py +++ b/tests/test_manifests.py @@ -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__':