Example #1
0
 def test_okay(self):
     fp = StringIO(one_pixel_jpeg)
     compare(
         is_image(dict(mimetype='image/jpeg',
                       fp=fp)),
         True
         )
     compare(fp.tell(),0)
Example #2
0
 def test_not_image_data(self):
     compare(
         is_image(dict(mimetype='image/jpeg',
                       fp=StringIO('foo'))),
         'This file is not an image'
         )
Example #3
0
 def test_wrong_mimetype(self):
     compare(
         is_image(dict(mimetype='foo')),
         'This file is not an image'
         )