Пример #1
0
    def test_render(self):
        """Does not parse, uses PARAMS dict to render tile"""
        with IIIF.render(TEST_IMG_PATH, **Parse.uri(TEST_URI)) as t1:
            with IIIF.render(TEST_IMG_PATH, **PARAMS) as t2:
                self.assertTrue(t1.contents() == t2.contents(),
                                "Parsing uri behaving differently "
                                "than PARAMS")

                im = Image.open(t1)
                self.assertTrue(im.size == (1000, EXPECTED_HEIGHT),
                                "Tile is the wrong dimensions: "
                                "Expected %s got %s."
                                % ((1000, EXPECTED_HEIGHT), im.size))
                im.close()
Пример #2
0
 def test_parse(self):
     params = Parse.uri(TEST_URI)
     self.assertTrue(params == PARAMS, "Param matching failed. "
                     "%s v. %s" % (params, PARAMS))