~ubuntu-branches/ubuntu/wily/python-imaging/wily

« back to all changes in this revision

Viewing changes to Tests/test_image_point.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-01-31 20:49:20 UTC
  • mfrom: (27.1.1 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20130131204920-b5zshy6vgfvdionl
Tags: 1.1.7+1.7.8-1ubuntu1
Rewrite build dependencies to allow cross builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from tester import *
 
2
 
 
3
from PIL import Image
 
4
 
 
5
def test_sanity():
 
6
    
 
7
    im = lena()
 
8
 
 
9
    assert_exception(ValueError, lambda: im.point(list(range(256))))
 
10
    assert_no_exception(lambda: im.point(list(range(256))*3))
 
11
    assert_no_exception(lambda: im.point(lambda x: x))
 
12
 
 
13
    im = im.convert("I")
 
14
    assert_exception(ValueError, lambda: im.point(list(range(256))))
 
15
    assert_no_exception(lambda: im.point(lambda x: x*1))
 
16
    assert_no_exception(lambda: im.point(lambda x: x+1))
 
17
    assert_no_exception(lambda: im.point(lambda x: x*1+1))
 
18
    assert_exception(TypeError, lambda: im.point(lambda x: x-1))
 
19
    assert_exception(TypeError, lambda: im.point(lambda x: x/1))