added tests to cover save of four different png transparencies

This commit is contained in:
David Schmidt 2013-03-26 11:24:07 +01:00
parent 638889cae0
commit 5303f0ea66
4 changed files with 39 additions and 11 deletions

BIN
Tests/images/l_trns.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -128,6 +128,34 @@ def test_load_transparent_p():
# image has 124 uniqe qlpha values # image has 124 uniqe qlpha values
assert_equal(len(im.split()[3].getcolors()), 124) assert_equal(len(im.split()[3].getcolors()), 124)
def test_save_p_transparent_palette():
in_file = "Tests/images/pil123p.png"
im = Image.open(in_file)
file = tempfile("temp.png")
assert_no_exception(lambda: im.save(file))
def test_save_p_single_transparency():
in_file = "Tests/images/p_trns_single.png"
im = Image.open(in_file)
file = tempfile("temp.png")
assert_no_exception(lambda: im.save(file))
def test_save_l_transparency():
in_file = "Tests/images/l_trns.png"
im = Image.open(in_file)
file = tempfile("temp.png")
assert_no_exception(lambda: im.save(file))
def test_save_rgb_single_transparency():
in_file = "Tests/images/caption_6_33_22.png"
im = Image.open(in_file)
file = tempfile("temp.png")
assert_no_exception(lambda: im.save(file))
def test_load_verify(): def test_load_verify():
# Check open/load/verify exception (@PIL150) # Check open/load/verify exception (@PIL150)