(self)
| 1509 | self.assertEqual(tr.traced, []) |
| 1510 | |
| 1511 | def test_add(self): |
| 1512 | tr = self.tracers |
| 1513 | func = Func() |
| 1514 | cb = tr.make_callback = mock.Mock(return_value=func) |
| 1515 | |
| 1516 | iv = tr.add(self.iv, self.var_changed_increment) |
| 1517 | self.assertIs(iv, self.iv) |
| 1518 | bv = tr.add(self.bv, self.var_changed_boolean) |
| 1519 | self.assertIs(bv, self.bv) |
| 1520 | |
| 1521 | sv = StringVar(root) |
| 1522 | sv2 = tr.add(sv, ('main', 'section', 'option')) |
| 1523 | self.assertIs(sv2, sv) |
| 1524 | cb.assert_called_once() |
| 1525 | cb.assert_called_with(sv, ('main', 'section', 'option')) |
| 1526 | |
| 1527 | expected = [(iv, self.var_changed_increment), |
| 1528 | (bv, self.var_changed_boolean), |
| 1529 | (sv, func)] |
| 1530 | self.assertEqual(tr.traced, []) |
| 1531 | self.assertEqual(tr.untraced, expected) |
| 1532 | |
| 1533 | del tr.make_callback |
| 1534 | |
| 1535 | def test_make_callback(self): |
| 1536 | cb = self.tracers.make_callback(self.iv, ('main', 'section', 'option')) |
nothing calls this directly
no test coverage detected