from __future__ import print_function import hashlib import sys import unittest import pgmagick from pgmagick.api import Image, Draw print(pgmagick.gminfo().version) LIBGM_VERSION = [int(v) for v in pgmagick.gminfo().version.split('.')] class ImageTestCase(unittest.TestCase): def setUp(self): self.img = Image((600, 400), 'red') def test_unicodefilename(self): self.img.write('unicode.png') img = Image(u'unicode.png') img.scale(0.5) img.write(u'unicode.jpg') def test_nonarg(self): Image() def test_arg(self): Image((600, 400), 'red') def test_arg_float(self): Image((600.5, 400.4), 'red')
import unittest import sys sys.path.append('../') sys.path.append('./') import pgmagick from pgmagick.api import Image, Draw print(pgmagick.gminfo().version) libgm_version = [int(v) for v in pgmagick.gminfo().version.split('.')] class ImageTestCase(unittest.TestCase): def setUp(self): self.img = Image((600, 400), 'red') def test_unicodefilename(self): self.img.write('unicode.png') if sys.version_info >= (3, ): img = Image('unicode.png') else: img = Image(unicode('unicode.png')) img.scale(0.5) if sys.version_info >= (3, ): img.write('unicode.jpg') else: img.write(unicode('unicode.jpg')) def test_nonarg(self): Image()
import unittest import sys sys.path.append('../') sys.path.append('./') import pgmagick from pgmagick.api import Image, Draw print(pgmagick.gminfo().version) libgm_version = [int(v) for v in pgmagick.gminfo().version.split('.')] class ImageTestCase(unittest.TestCase): def setUp(self): self.img = Image((600, 400), 'red') def test_unicodefilename(self): self.img.write('unicode.png') if sys.version_info >= (3, ): img = Image('unicode.png') else: img = Image(unicode('unicode.png')) img.scale(0.5) if sys.version_info >= (3, ): img.write('unicode.jpg') else: img.write(unicode('unicode.jpg')) def test_nonarg(self): Image() def test_arg(self):
from __future__ import print_function import hashlib import sys import unittest import pgmagick from pgmagick.api import Image, Draw print(pgmagick.gminfo().version) LIBGM_VERSION = [int(v) for v in pgmagick.gminfo().version.split('.')] class ImageTestCase(unittest.TestCase): def setUp(self): self.img = Image((600, 400), 'red') def test_unicodefilename(self): self.img.write('unicode.png') img = Image(u'unicode.png') img.scale(0.5) img.write(u'unicode.jpg') def test_nonarg(self): Image() def test_arg(self): Image((600, 400), 'red') def test_arg_float(self):