Skip to content

Commit

Permalink
Remove test_pattern_resize test
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
elParaguayo committed Sep 6, 2024
1 parent 8759f1d commit 102cd67
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions test/test_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 102cd67

Please sign in to comment.