Skip to content

Commit df4bb34

Browse files
committed
Added test
1 parent 192aae9 commit df4bb34

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Tests/test_imageops.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ def test_contain(new_size):
110110
assert new_im.size == (256, 256)
111111

112112

113+
def test_contain_round():
114+
im = Image.new("1", (43, 63), 1)
115+
new_im = ImageOps.contain(im, (5, 7))
116+
assert new_im.width == 5
117+
118+
im = Image.new("1", (63, 43), 1)
119+
new_im = ImageOps.contain(im, (7, 5))
120+
assert new_im.height == 5
121+
122+
113123
def test_pad():
114124
# Same ratio
115125
im = hopper()

0 commit comments

Comments
 (0)