mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-10 16:22:22 +03:00
Unit testing
This commit is contained in:
parent
f6df61dc37
commit
90a832ef03
|
@ -290,9 +290,21 @@ class TestImageResize:
|
|||
assert out.mode == mode
|
||||
assert out.size == tuple(size)
|
||||
|
||||
def resize_scale(mode: str, scale: float) -> None:
|
||||
img = hopper(mode)
|
||||
size = (
|
||||
int(self.width * scale),
|
||||
int(self.height * scale)
|
||||
)
|
||||
out = img.resize(scale=scale)
|
||||
assert out.mode == mode
|
||||
assert out.size == tuple(size)
|
||||
|
||||
for mode in "1", "P", "L", "RGB", "I", "F":
|
||||
resize(mode, (112, 103))
|
||||
resize(mode, [188, 214])
|
||||
# test scale refactoring
|
||||
resize_scale(mode, 0.5)
|
||||
|
||||
# Test unknown resampling filter
|
||||
with hopper() as im:
|
||||
|
|
Loading…
Reference in New Issue
Block a user