Change command line program to accept face dimensions as arguments, not transparency.
[toast/gimp_passport.git] / test_gimp_passport.py
index 582c308..3c79c1f 100644 (file)
@@ -13,11 +13,11 @@ class TestMakePassport(unittest.TestCase):
 
     def test_make_passport(self):
         dpi = 90
-        img = Image.new('RGBA', (mm_to_pixel(60, dpi), mm_to_pixel(80, dpi)), '#bbbbbb00')
+        img = Image.new('RGB', (mm_to_pixel(60, dpi), mm_to_pixel(80, dpi)), '#bbbbbb')
         img.info['dpi'] = (dpi, dpi)
         draw = ImageDraw.ImageDraw(img)
         draw.rectangle((50, 60, 150, 170), fill='#00bbbbff')
-        pic = make_passport(img, 0.75, 35., 45.)
+        pic = make_passport(img, (50, 60, 150, 170), 0.75, 35., 45.)
         self.assertIsInstance(pic, Image.Image)
 
     def test_num_tiles(self):
@@ -51,9 +51,9 @@ class TestMakePassport(unittest.TestCase):
         self.assertIsInstance(paper, Image.Image)
 
     def test_main(self):
-        source = 'test_image.png'
-        dest = 'test_image_result.png'
+        source = 'test_image.jpg'
+        dest = 'test_image_result.jpg'
         if os.path.exists(dest):
             os.remove(dest)
-        main(35., 45., 4., 100., 150., 0., source, dest)
+        main(35., 45., 4., 100., 150., 0., (1108, 280, 2180, 1620), source, dest)
         self.assertTrue(os.path.exists(dest))