From 102cd6721ac0a464300528e03d04d917f088de1c Mon Sep 17 00:00:00 2001 From: elParaguayo Date: Fri, 6 Sep 2024 14:32:14 +0100 Subject: [PATCH] Remove test_pattern_resize test Unlike `cairocffi.ImageSurface.create_from_png`, using `cairocffi.pixbuf.decode_to_image_surface` automatically resizes the image to the provided dimensions. There is therefore no need to check transformation matrices. --- test/test_images.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/test/test_images.py b/test/test_images.py index 53997da57f..358d2a3109 100644 --- a/test/test_images.py +++ b/test/test_images.py @@ -122,19 +122,6 @@ def test_pattern(self, path_n_bytes_image): img = images.Img(bytes_image) assert isinstance(img.pattern, cairocffi.SurfacePattern) - def test_pattern_resize(self, path_n_bytes_image_pngs): - path, bytes_image = path_n_bytes_image_pngs - img = images.Img.from_path(path) - assert isinstance(img.pattern, cairocffi.SurfacePattern) - t_matrix = img.pattern.get_matrix().as_tuple() - assert_approx_equal(t_matrix, (1.0, 0.0, 0.0, 1.0)) - img.width = 2.0 * img.default_size.width - t_matrix = img.pattern.get_matrix().as_tuple() - assert_approx_equal(t_matrix, (0.5, 0.0, 0.0, 1.0)) - img.height = 3.0 * img.default_size.height - t_matrix = img.pattern.get_matrix().as_tuple() - assert_approx_equal(t_matrix, (0.5, 0.0, 0.0, 1.0 / 3.0)) - def test_pattern_rotate(self, path_n_bytes_image): path, bytes_image = path_n_bytes_image img = images.Img(bytes_image)