(self)
| 685 | self.assertEqual(b.b, 100.0) |
| 686 | |
| 687 | def test_notify_subclass(self): |
| 688 | class A(HasTraits): |
| 689 | a = Int() |
| 690 | |
| 691 | class B(A): |
| 692 | b = Float() |
| 693 | |
| 694 | b = B() |
| 695 | b.observe(self.notify1, "a") |
| 696 | b.observe(self.notify2, "b") |
| 697 | b.a = 0 |
| 698 | b.b = 0.0 |
| 699 | self.assertEqual(len(self._notify1), 0) |
| 700 | self.assertEqual(len(self._notify2), 0) |
| 701 | b.a = 10 |
| 702 | b.b = 10.0 |
| 703 | change = change_dict("a", 0, 10, b, "change") |
| 704 | self.assertTrue(change in self._notify1) |
| 705 | change = change_dict("b", 0.0, 10.0, b, "change") |
| 706 | self.assertTrue(change in self._notify2) |
| 707 | |
| 708 | def test_static_notify(self): |
| 709 | class A(HasTraits): |
nothing calls this directly
no test coverage detected