mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Added test
This commit is contained in:
parent
12cefd798e
commit
cac1a04329
|
@ -2,6 +2,7 @@ from __future__ import annotations
|
|||
|
||||
import contextlib
|
||||
import os.path
|
||||
from typing import Sequence
|
||||
|
||||
import pytest
|
||||
|
||||
|
@ -265,6 +266,21 @@ def test_chord_too_fat() -> None:
|
|||
assert_image_equal_tofile(im, "Tests/images/imagedraw_chord_too_fat.png")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("mode", ("RGB", "L"))
|
||||
@pytest.mark.parametrize("xy", ((W / 2, H / 2), [W / 2, H / 2]))
|
||||
def test_circle(mode: str, xy: Sequence[float]) -> None:
|
||||
# Arrange
|
||||
im = Image.new(mode, (W, H))
|
||||
draw = ImageDraw.Draw(im)
|
||||
expected = f"Tests/images/imagedraw_ellipse_{mode}.png"
|
||||
|
||||
# Act
|
||||
draw.circle(xy, 25, fill="green", outline="blue")
|
||||
|
||||
# Assert
|
||||
assert_image_similar_tofile(im, expected, 1)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("mode", ("RGB", "L"))
|
||||
@pytest.mark.parametrize("bbox", BBOX)
|
||||
def test_ellipse(mode: str, bbox: Coords) -> None:
|
||||
|
|
Loading…
Reference in New Issue
Block a user