Exemplo n.º 1
0
    def test_image_good(self):
        write_image = Image.open(
            os.path.join(os.path.dirname(__file__), 'rainier.jpg'))
        t = Thumbnailer()
        thumb_image = t.make_thumbnail(write_image)

        assert thumb_image.size == (100, 100)
        write_image.show()
        thumb_image.show()
Exemplo n.º 2
0
 def test_image_bad(self):
     t = Thumbnailer()
     with pytest.raises(Exception):
         thumb = t.make_thumbnail("Not an image")