def testDraw(self): w, h, path = 68, 72, 'polygon 14,12 64,0 68,72 0,54' l = [] for i in range(10): im = Image.create(w, h, Color.named("blue")) im.draw(path) l.append(im)
def testGetPixels(self): im = Image.create(100, 100, Color.named('white')) with im.getPixels(50, 50, 50, 50) as px: p0 = px[0, 0] self.assertEqual((p0.red, p0.green, p0.blue), (65535, 65535, 65535)) p0 = px[49, 49] self.assertEqual((p0.red, p0.green, p0.blue), (65535, 65535, 65535))
def testImage(self): for i in range(1*self.mult): self.show('Image', i) im = [] for j in range(10): im.append(Image.create(1024, 1024, Color.named("white"))) if self.verbose > 1: import os with open('/proc/{0}/status'.format(os.getpid()), 'rt') as f: for line in f: if 'VmData' in line: print(line.strip())
def testImage(self): for i in range(1 * self.mult): self.show('Image', i) im = [] for j in range(10): im.append(Image.create(1024, 1024, Color.named("white"))) if self.verbose > 1: import os with open('/proc/{0}/status'.format(os.getpid()), 'rt') as f: for line in f: if 'VmData' in line: print(line.strip())
def testBackgroundColor(self): im = self.testRead() im.setBackgroundColor(Color.named('red'))
def testNewImage(self): im = Image.create(100, 100, Color.named("blue")) self.assertTrue(im) return im
def testStr(self): c = Color.named("yellow") self.assertEqual('#ffff0000', str(c))
def testYellow(self): c = Color.named("yellow") self.assertEqual('<Color: rgba(65535,65535,0,0)>', repr(c))
def testBlue(self): c = Color.named("blue") self.assertEqual('<Color: rgba(0,0,65535,0)>', repr(c))
def testStr(self): c = Color.named("yellow") self.assertEqual("#ffff0000", str(c))
def testYellow(self): c = Color.named("yellow") self.assertEqual("<Color: rgba(65535,65535,0,0)>", repr(c))
def testBlue(self): c = Color.named("blue") self.assertEqual("<Color: rgba(0,0,65535,0)>", repr(c))