Skip to content

Commit 9776379

Browse files
author
Johann Krauter
committed
added some more unittest, just in case...
1 parent 135d7cb commit 9776379

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

lib/matplotlib/tests/test_patches.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,42 @@ def test_ellipse_vertices():
125125
],
126126
)
127127

128+
assert_almost_equal(
129+
Ellipse(xy=(0, 0), width=0, height=0, angle=0).get_vertices(),
130+
[(0.0, 0.0), (0.0, 0.0)],
131+
)
132+
assert_almost_equal(
133+
Ellipse(xy=(0, 0), width=0, height=0, angle=0).get_co_vertices(),
134+
[(0.0, 0.0), (0.0, 0.0)],
135+
)
136+
137+
assert_almost_equal(
138+
Ellipse(xy=(0, 0), width=1, height=0, angle=0).get_vertices(),
139+
[(-0.5, 0.0), (0.5, 0.0)],
140+
)
141+
assert_almost_equal(
142+
Ellipse(xy=(0, 0), width=1, height=0, angle=0).get_co_vertices(),
143+
[(0.0, 0.0), (0.0, 0.0)],
144+
)
145+
146+
assert_almost_equal(
147+
Ellipse(xy=(0, 0), width=1, height=1, angle=0).get_vertices(),
148+
[(-0.5, 0.0), (0.5, 0.0)],
149+
)
150+
assert_almost_equal(
151+
Ellipse(xy=(0, 0), width=1, height=1, angle=0).get_co_vertices(),
152+
[(0.0, 0.5), (0.0, -0.5)],
153+
)
154+
155+
assert_almost_equal(
156+
Ellipse(xy=(0, 0), width=1, height=0.5, angle=90).get_vertices(),
157+
[(0.0, -0.5), (0.0, 0.5)],
158+
)
159+
assert_almost_equal(
160+
Ellipse(xy=(0, 0), width=1, height=0.5, angle=90).get_co_vertices(),
161+
[(-0.25, 0.0), (0.25, 0.0)],
162+
)
163+
128164

129165
def test_rotate_rect():
130166
loc = np.asarray([1.0, 2.0])

0 commit comments

Comments
 (0)