Add some more pdf tests

This commit is contained in:
hugovk 2014-05-11 17:16:13 +03:00
parent f165d2034f
commit c15601e0b0

View File

@ -2,10 +2,10 @@ from tester import *
import os.path
def test_to_pdf():
def helper_save_as_pdf(mode):
# Arrange
im = lena()
outfile = tempfile("temp.pdf")
im = lena(mode)
outfile = tempfile("temp_" + mode + ".pdf")
# Act
im.save(outfile)
@ -14,4 +14,37 @@ def test_to_pdf():
assert_true(os.path.isfile(outfile))
assert_greater(os.path.getsize(outfile), 0)
def test_greyscale():
# Arrange
mode = "L"
# Act / Assert
helper_save_as_pdf(mode)
def test_rgb():
# Arrange
mode = "RGB"
# Act / Assert
helper_save_as_pdf(mode)
def test_p_mode():
# Arrange
mode = "P"
# Act / Assert
helper_save_as_pdf(mode)
def test_cmyk_mode():
# Arrange
mode = "P"
# Act / Assert
helper_save_as_pdf(mode)
# End of file