(self)
| 306 | t.transform([[1, 2, 3]]) |
| 307 | |
| 308 | def test_copy(self): |
| 309 | a = mtransforms.Affine2D() |
| 310 | b = mtransforms.Affine2D() |
| 311 | s = a + b |
| 312 | # Updating a dependee should invalidate a copy of the dependent. |
| 313 | s.get_matrix() # resolve it. |
| 314 | s1 = copy.copy(s) |
| 315 | assert not s._invalid and not s1._invalid |
| 316 | a.translate(1, 2) |
| 317 | assert s._invalid and s1._invalid |
| 318 | assert (s1.get_matrix() == a.get_matrix()).all() |
| 319 | # Updating a copy of a dependee shouldn't invalidate a dependent. |
| 320 | s.get_matrix() # resolve it. |
| 321 | b1 = copy.copy(b) |
| 322 | b1.translate(3, 4) |
| 323 | assert not s._invalid |
| 324 | assert_array_equal(s.get_matrix(), a.get_matrix()) |
| 325 | |
| 326 | def test_deepcopy(self): |
| 327 | a = mtransforms.Affine2D() |
nothing calls this directly
no test coverage detected