mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-21 01:32:00 +03:00
branch
This commit is contained in:
parent
dfea906a80
commit
26848c48a7
38
Tests/test_new_cms.py
Normal file
38
Tests/test_new_cms.py
Normal file
|
@ -0,0 +1,38 @@
|
|||
import pytest
|
||||
from PIL import ImageCms
|
||||
|
||||
def test_buildTransform_flags_non_integer():
|
||||
with pytest.raises(ImageCms.PyCMSError):
|
||||
ImageCms.buildTransform(
|
||||
inputProfile="path/to/input/profile",
|
||||
outputProfile="path/to/output/profile",
|
||||
inMode="RGB",
|
||||
outMode="CMYK",
|
||||
renderingIntent=ImageCms.Intent.PERCEPTUAL,
|
||||
flags="not_an_integer" # This should not be an integer
|
||||
)
|
||||
|
||||
def test_buildTransform_flags_out_of_range():
|
||||
with pytest.raises(ImageCms.PyCMSError):
|
||||
ImageCms.buildTransform(
|
||||
inputProfile="path/to/input/profile",
|
||||
outputProfile="path/to/output/profile",
|
||||
inMode="RGB",
|
||||
outMode="CMYK",
|
||||
renderingIntent=ImageCms.Intent.PERCEPTUAL,
|
||||
flags=999999 # Assuming this value is outside the valid range
|
||||
)
|
||||
|
||||
def test_renderingIntent_non_integer():
|
||||
with pytest.raises(ImageCms.PyCMSError) as exc_info:
|
||||
ImageCms.buildTransform(
|
||||
inputProfile="path/to/input/profile",
|
||||
outputProfile="path/to/output/profile",
|
||||
inMode="RGB",
|
||||
outMode="CMYK",
|
||||
renderingIntent="not an integer", # This should trigger the error
|
||||
flags=0
|
||||
)
|
||||
assert str(exc_info.value) == "renderingIntent must be an integer between 0 and 3"
|
||||
|
||||
|
|
@ -20,7 +20,8 @@ def calculate_coverage(test_name):
|
|||
"branches2": PdfParser.XrefTable.branches, # duru
|
||||
"branches3": SpiderImagePlugin.branches, # isidora
|
||||
"branches4": MpegImagePlugin.BitStream.branches, # isidora
|
||||
"branches6": ImageFile.PyEncoder.branches, # deekshu
|
||||
"branches5": ImageCms.branches, # deekshu
|
||||
"branches6": ImageFile.branches, # deekshu
|
||||
# Add more
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user