class StickerTest(unittest.TestCase): code = "code" line = "line" def setUp(self): self.sticker = Sticker(self.code, self.line) def test_build(self): """Make sure image can be built, that it is quadratic, and verify its size. """ img = self.sticker.build() self.assertTrue(hasattr(img, 'save')) s1, s2 = img.size self.assertTrue(s1 == s2) self.assertTrue(s1 >= self.sticker.want_size) self.assertTrue(s2 >= self.sticker.want_size)
def setUp(self): self.sticker = Sticker(self.code, self.line)