mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
Failing test for #1744
This commit is contained in:
parent
648030eb7e
commit
39e407dbc1
|
@ -52,6 +52,20 @@ class TestImageCrop(PillowTestCase):
|
||||||
self.assertEqual(len(im.getdata()), 0)
|
self.assertEqual(len(im.getdata()), 0)
|
||||||
self.assertRaises(IndexError, lambda: im.getdata()[0])
|
self.assertRaises(IndexError, lambda: im.getdata()[0])
|
||||||
|
|
||||||
|
def test_crop_float(self):
|
||||||
|
# Check cropping floats are rounded to nearest integer
|
||||||
|
# https://github.com/python-pillow/Pillow/issues/1744
|
||||||
|
|
||||||
|
# Arrange
|
||||||
|
im = Image.new("RGB", (10, 10))
|
||||||
|
self.assertEqual(im.size, (10, 10))
|
||||||
|
|
||||||
|
# Act
|
||||||
|
cropped = im.crop((0.9, 1.1, 4.2, 5.8))
|
||||||
|
|
||||||
|
# Assert
|
||||||
|
self.assertEqual(cropped.size, (3, 5))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user