Esempio n. 1
0
 def iiif_is_down_cluster_browse_elegant_fail(self):
     """
     If the IIIF server is down, the code to get the links for the
     cluster browse listing should return an empty string.  This
     will lead to "are you sure you typed the right URL" in the
     page.
     """
     assert not DisplayBrowse.get_cbrowse_items(
         collection1,
         browse1_1,
         browse_type1,
         modify=Testing.bring_website_down
     )
     assert not DisplayBrowse.get_cbrowse_items(
         collection1,
         browse1_2,
         browse_type1,
         modify=Testing.bring_website_down
     )
     assert not DisplayBrowse.get_cbrowse_items(
         collection1,
         browse2_1,
         browse_type2,
         modify=Testing.bring_website_down
     )
     assert not DisplayBrowse.get_cbrowse_items(
         collection1,
         browse2_2,
         browse_type2,
         modify=Testing.bring_website_down
     )
Esempio n. 2
0
 def cluster_browse_404(self):
     """
     If there's a 404 error connecting to IIIF while getting the
     cluster browse JSON, the page should display a 'maybe you
     typed the wrong URL' message.
     """
     assert not DisplayBrowse.get_cbrowse_items(
         collection1,
         browse1_1,
         browse_type1,
         modify=Testing.change_status_code(404)
     )
     assert not DisplayBrowse.get_cbrowse_items(
         collection1,
         browse1_2,
         browse_type1,
         modify=Testing.change_status_code(404)
     )
     assert not DisplayBrowse.get_cbrowse_items(
         collection1,
         browse2_1,
         browse_type2,
         modify=Testing.change_status_code(404)
     )
     assert not DisplayBrowse.get_cbrowse_items(
         collection1,
         browse2_2,
         browse_type2,
         modify=Testing.change_status_code(404)
     )
Esempio n. 3
0
 def cluster_browse_listing_works(self):
     """
     Make sure we can pull the links for items falling under a
     particular cluster browse from IIIF.
     """
     assert DisplayBrowse.get_cbrowse_items(
         collection1,
         browse1_1,
         browse_type1,
     )
     assert DisplayBrowse.get_cbrowse_items(
         collection1,
         browse1_2,
         browse_type1,
     )
     assert DisplayBrowse.get_cbrowse_items(
         collection1,
         browse2_1,
         browse_type2,
     )
     assert DisplayBrowse.get_cbrowse_items(
         collection1,
         browse2_2,
         browse_type2,
     )
Esempio n. 4
0
 def iiif_is_down_browse_type_elegant_fail(self):
     """
     If the IIIF server is down, the code to get the browse type listing
     links should return an empty string.  This will lead to the
     "are you sure you typed the right URL" message on the page.
     """
     assert not DisplayBrowse.get_iiif_labels(
         CBrowseURL.mk_cbrowse_type_url_iiif(collection1, browse_type1),
         browse_type1,
         collection1,
         modify=Testing.bring_website_down,
     )
     assert not DisplayBrowse.get_iiif_labels(
         CBrowseURL.mk_cbrowse_type_url_iiif(collection1, browse_type2),
         browse_type2,
         collection1,
         modify=Testing.bring_website_down,
     )
Esempio n. 5
0
    def list_browse_listing_works(self):
        """
        Make sure we can pull the links for items falling under a
        particular list browse from IIIF.
        """
        assert DisplayBrowse.get_lbrowse_items(
            collection1,
            list_browse1,

        )
Esempio n. 6
0
 def list_browse_404(self):
     """
     If there's a 404 error connecting to IIIF while getting the list
     browse JSON, the page should display a 'maybe you typed the
     wrong URL' message.
     """
     assert not DisplayBrowse.get_lbrowse_items(
         collection1,
         list_browse1,
         modify=Testing.change_status_code(404)
     )
Esempio n. 7
0
    def browse_type_404(self):
        """
        If there's a 404 error connecting to IIIF while getting the browse
        type JSON, the page should display a 'maybe you typed the
        wrong URL' message.  In this case, that means the
        get_iiif_labels function should return an empty string.
        """
        assert not DisplayBrowse.get_iiif_labels(
            CBrowseURL.mk_cbrowse_type_url_iiif(collection1, browse_type1),
            browse_type1,
            collection1,
            modify=Testing.change_status_code(404)
        )

        assert not DisplayBrowse.get_iiif_labels(
            CBrowseURL.mk_cbrowse_type_url_iiif(collection1, browse_type2),
            browse_type2,
            collection1,
            modify=Testing.change_status_code(404)
        )
Esempio n. 8
0
    def browse_type_listing_works(self):
        """
        Make sure we can pull the browse type links down from IIIF.
        """

        iiif_url1 = CBrowseURL.mk_cbrowse_type_url_iiif(
            collection1, browse_type1)
        iiif_url2 = CBrowseURL.mk_cbrowse_type_url_iiif(
            collection1, browse_type2)

        assert DisplayBrowse.get_iiif_labels(
            iiif_url1,
            browse_type1,
            collection1,
        )
        assert DisplayBrowse.get_iiif_labels(
            iiif_url2,
            browse_type2,
            collection1,
        )