Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Pillow / Tests / test_image_tobitmap.py
Size: Mime:
from helper import unittest, PillowTestCase, hopper, fromstring


class TestImageToBitmap(PillowTestCase):

    def test_sanity(self):

        self.assertRaises(ValueError, lambda: hopper().tobitmap())

        im1 = hopper().convert("1")

        bitmap = im1.tobitmap()

        self.assertIsInstance(bitmap, bytes)
        self.assert_image_equal(im1, fromstring(bitmap))


if __name__ == '__main__':
    unittest.main()