mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 13:46:57 +03:00
26 lines
689 B
Python
26 lines
689 B
Python
from helper import unittest, PillowTestCase, lena
|
|
|
|
|
|
class TestImageOffset(PillowTestCase):
|
|
|
|
def test_offset(self):
|
|
|
|
im1 = lena()
|
|
|
|
im2 = self.assert_warning(DeprecationWarning, lambda: im1.offset(10))
|
|
self.assertEqual(im1.getpixel((0, 0)), im2.getpixel((10, 10)))
|
|
|
|
im2 = self.assert_warning(
|
|
DeprecationWarning, lambda: im1.offset(10, 20))
|
|
self.assertEqual(im1.getpixel((0, 0)), im2.getpixel((10, 20)))
|
|
|
|
im2 = self.assert_warning(
|
|
DeprecationWarning, lambda: im1.offset(20, 20))
|
|
self.assertEqual(im1.getpixel((0, 0)), im2.getpixel((20, 20)))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|
|
|
|
# End of file
|