(self)
| 488 | self.assertEqual(b.b, 100.0) |
| 489 | |
| 490 | def test_notify_subclass(self): |
| 491 | class A(HasTraits): |
| 492 | a = Int() |
| 493 | |
| 494 | class B(A): |
| 495 | b = Float() |
| 496 | |
| 497 | b = B() |
| 498 | b.on_trait_change(self.notify1, "a") |
| 499 | b.on_trait_change(self.notify2, "b") |
| 500 | b.a = 0 |
| 501 | b.b = 0.0 |
| 502 | self.assertEqual(len(self._notify1), 0) |
| 503 | self.assertEqual(len(self._notify2), 0) |
| 504 | b.a = 10 |
| 505 | b.b = 10.0 |
| 506 | self.assertTrue(("a", 0, 10) in self._notify1) |
| 507 | self.assertTrue(("b", 0.0, 10.0) in self._notify2) |
| 508 | |
| 509 | def test_static_notify(self): |
| 510 | class A(HasTraits): |
nothing calls this directly
no test coverage detected