2014-09-05 14:03:56 +04:00
|
|
|
from helper import unittest, PillowTestCase, hopper, py3
|
2016-01-04 00:04:04 +03:00
|
|
|
import sys
|
2012-10-16 00:26:38 +04:00
|
|
|
|
2016-02-05 01:57:13 +03:00
|
|
|
|
2014-06-10 13:10:47 +04:00
|
|
|
class TestImageGetIm(PillowTestCase):
|
2012-10-16 00:26:38 +04:00
|
|
|
|
2014-06-10 13:10:47 +04:00
|
|
|
def test_sanity(self):
|
2014-09-05 14:03:56 +04:00
|
|
|
im = hopper()
|
2014-06-10 13:10:47 +04:00
|
|
|
type_repr = repr(type(im.getim()))
|
2012-10-15 09:55:39 +04:00
|
|
|
|
2014-06-10 13:10:47 +04:00
|
|
|
if py3:
|
|
|
|
self.assertIn("PyCapsule", type_repr)
|
2012-10-16 00:26:38 +04:00
|
|
|
|
2016-01-04 00:04:04 +03:00
|
|
|
if sys.hexversion < 0x2070000:
|
|
|
|
# py2.6 x64, windows
|
2016-01-03 23:20:19 +03:00
|
|
|
target_types = (int, long)
|
2016-01-04 00:04:04 +03:00
|
|
|
else:
|
2016-01-03 23:20:19 +03:00
|
|
|
target_types = (int)
|
|
|
|
|
|
|
|
self.assertIsInstance(im.im.id, target_types)
|
2012-10-16 00:26:38 +04:00
|
|
|
|
2014-06-10 13:10:47 +04:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|
|
|
|
|
|
|
|
# End of file
|