class PresentationManifestTester(unittest.TestCase):
    def __init__(self, *args, **kwargs):
        super(PresentationManifestTester, self).__init__(*args, **kwargs)
        self.book_pages = [
            ("agrtfhs:2279", 1),
            ("agrtfhs:2278", 2),
            ("agrtfhs:2291", 3),
            ("agrtfhs:2290", 4),
            ("agrtfhs:2289", 5),
            ("agrtfhs:2288", 6),
            ("agrtfhs:2287", 7),
            ("agrtfhs:2286", 8),
            ("agrtfhs:2285", 9),
            ("agrtfhs:2284", 10),
            ("agrtfhs:2283", 11),
            ("agrtfhs:2282", 12),
            ("agrtfhs:2281", 13),
            ("agrtfhs:2280", 14),
            ("agrtfhs:2277", 15),
            ("agrtfhs:2276", 16),
        ]
        self.metadata = MODSScraper(
            "agrtfhs:2275").build_iiif_descriptive_metadata_v2()
        self.collection = "collections:agrtfhs"
        self.validator = IIIFValidator(debug=True, collect_warnings=False)

    def test_presentation_manifest(self):
        manifest = Manifest(self.metadata, self.book_pages, self.collection)
        self.validator.validate(manifest.manifest_json)
        self.assertTrue(self.validator.is_valid)
def test_iiif_manifest_schema(running_app, es_clear, client_with_login,
                              headers, minimal_record):
    client = client_with_login
    file_id = "test_image.png"
    recid = publish_record_with_images(client, file_id, minimal_record,
                                       headers)
    response = client.get(f"/iiif/record:{recid}/manifest")
    manifest = response.json
    validator = IIIFValidator(fail_fast=False)
    validator.validate(manifest)
    assert not validator.errors