Commits

Fredrik Lundh committed f011e49

added test boilerplate for core modules

  • Participants
  • Parent commits e1a64ca

Comments (0)

Files changed (21)

File PIL/ImageShow.py

         _viewers.append(viewer)
     elif order < 0:
         _viewers.insert(0, viewer)
-    print _viewers
 
 ##
 # Displays a given image.

File Tests/run.py

     test = os.path.basename(file)
     print test, "..."
     out = os.popen("%s -u %s 2>&1" % (sys.executable, file))
-    result = out.read()
-    if result.strip() == "ok":
+    result = out.read().strip()
+    if result == "ok":
         result = None
+    elif result == "skip":
+        continue
+    elif not result:
+        result = "(no output)"
     status = out.close()
     if status or result:
         if status:

File Tests/test_imagechops.py

+from PIL import Image
+from PIL import ImageChops
+
+print "ok"

File Tests/test_imagecolor.py

 
 assert ImageColor.getcolor("black", "1") == 0
 assert ImageColor.getcolor("white", "1") == 255
+
+print "ok"

File Tests/test_imagedraw.py

+from PIL import Image
+from PIL import ImageDraw
+
+print "ok"
+

File Tests/test_imageenhance.py

+from PIL import Image
+from PIL import ImageEnhance
+
+print "ok"
+

File Tests/test_imagefile.py

+from PIL import Image
+from PIL import ImageFile
+
+print "ok"
+
+

File Tests/test_imagefilter.py

+from PIL import Image
+from PIL import ImageFilter
+
+print "ok"
+
+
+

File Tests/test_imagegrab.py

+from PIL import Image
+from PIL import ImageGrab
+
+print "ok"
+
+
+
+

File Tests/test_imagemath.py

+from PIL import Image
+from PIL import ImageMath
+
+print "ok"

File Tests/test_imagemode.py

+from PIL import Image
+from PIL import ImageMode
+
+ImageMode.getmode("1")
+ImageMode.getmode("L")
+ImageMode.getmode("P")
+ImageMode.getmode("RGB")
+ImageMode.getmode("I")
+ImageMode.getmode("F")
+
+m = ImageMode.getmode("1")
+assert m.mode == "1"
+assert m.bands == ("1",)
+assert m.basemode == "L"
+assert m.basetype == "L"
+
+m = ImageMode.getmode("RGB")
+assert m.mode == "RGB"
+assert m.bands == ("R", "G", "B")
+assert m.basemode == "RGB"
+assert m.basetype == "L"
+
+print "ok"

File Tests/test_imageops.py

+from PIL import Image
+from PIL import ImageOps
+
+print "ok"

File Tests/test_imagepalette.py

+from PIL import Image
+from PIL import ImagePalette
+
+print "ok"

File Tests/test_imagepath.py

+from PIL import Image
+from PIL import ImagePath
+
+print "ok"

File Tests/test_imageqt.py

+from PIL import Image
+try:
+    from PIL import ImageQt
+except ImportError:
+    print "skip"
+else:
+    print "ok"
+

File Tests/test_imagesequence.py

+from PIL import Image
+from PIL import ImageSequence
+
+print "ok"

File Tests/test_imageshow.py

+from PIL import Image
+from PIL import ImageShow
+
+print "ok"

File Tests/test_imagestat.py

+from PIL import Image
+from PIL import ImageStat
+
+print "ok"

File Tests/test_imagetk.py

+from PIL import Image
+from PIL import ImageTk
+
+print "ok"

File Tests/test_imagetransform.py

+from PIL import Image
+from PIL import ImageTransform
+
+ImageTransform.AffineTransform((1, 2, 3, 4, 5, 6))
+ImageTransform.ExtentTransform((1, 2, 3, 4))
+ImageTransform.QuadTransform((1, 2, 3, 4, 5, 6, 7, 8))
+ImageTransform.MeshTransform(((1, 2, 3, 4), (5, 6, 7, 8, 9, 10, 11, 12)))
+
+print "ok"

File Tests/test_imagewin.py

+from PIL import Image
+from PIL import ImageWin
+
+print "ok"