()
| 19 | |
| 20 | |
| 21 | def test_Polygon_close(): |
| 22 | #: GitHub issue #1018 identified a bug in the Polygon handling |
| 23 | #: of the closed attribute; the path was not getting closed |
| 24 | #: when set_xy was used to set the vertices. |
| 25 | |
| 26 | # open set of vertices: |
| 27 | xy = [[0, 0], [0, 1], [1, 1]] |
| 28 | # closed set: |
| 29 | xyclosed = xy + [[0, 0]] |
| 30 | |
| 31 | # start with open path and close it: |
| 32 | p = Polygon(xy, closed=True) |
| 33 | assert p.get_closed() |
| 34 | assert_array_equal(p.get_xy(), xyclosed) |
| 35 | p.set_xy(xy) |
| 36 | assert_array_equal(p.get_xy(), xyclosed) |
| 37 | |
| 38 | # start with closed path and open it: |
| 39 | p = Polygon(xyclosed, closed=False) |
| 40 | assert_array_equal(p.get_xy(), xy) |
| 41 | p.set_xy(xyclosed) |
| 42 | assert_array_equal(p.get_xy(), xy) |
| 43 | |
| 44 | # start with open path and leave it open: |
| 45 | p = Polygon(xy, closed=False) |
| 46 | assert not p.get_closed() |
| 47 | assert_array_equal(p.get_xy(), xy) |
| 48 | p.set_xy(xy) |
| 49 | assert_array_equal(p.get_xy(), xy) |
| 50 | |
| 51 | # start with closed path and leave it closed: |
| 52 | p = Polygon(xyclosed, closed=True) |
| 53 | assert_array_equal(p.get_xy(), xyclosed) |
| 54 | p.set_xy(xyclosed) |
| 55 | assert_array_equal(p.get_xy(), xyclosed) |
| 56 | |
| 57 | |
| 58 | def test_corner_center(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…