| 352 | |
| 353 | |
| 354 | def test_path_deepcopy(): |
| 355 | # Should not raise any error |
| 356 | verts = [[0, 0], [1, 1]] |
| 357 | codes = [Path.MOVETO, Path.LINETO] |
| 358 | path1 = Path(verts, readonly=True) |
| 359 | path2 = Path(verts, codes, readonly=True) |
| 360 | path1_copy = path1.deepcopy() |
| 361 | path2_copy = path2.deepcopy() |
| 362 | assert path1 is not path1_copy |
| 363 | assert path1.vertices is not path1_copy.vertices |
| 364 | assert_array_equal(path1.vertices, path1_copy.vertices) |
| 365 | assert path1.readonly |
| 366 | assert not path1_copy.readonly |
| 367 | assert path2 is not path2_copy |
| 368 | assert path2.vertices is not path2_copy.vertices |
| 369 | assert_array_equal(path2.vertices, path2_copy.vertices) |
| 370 | assert path2.codes is not path2_copy.codes |
| 371 | assert_array_equal(path2.codes, path2_copy.codes) |
| 372 | assert path2.readonly |
| 373 | assert not path2_copy.readonly |
| 374 | |
| 375 | |
| 376 | def test_path_deepcopy_cycle(): |