mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Add some more pdf tests
This commit is contained in:
parent
f165d2034f
commit
c15601e0b0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user