def test_setParentNoChangeNoNotify(self): a = self.newSysClock(tickRate=1000) b = CorrelatedClock(a, 1000, correlation=Correlation(0, 0)) c = CorrelatedClock(a, 1000, correlation=Correlation(10, 0)) d = MockDependent() b.bind(d) d.assertNotNotified() b.setParent(a) d.assertNotNotified() self.assertEquals(b.getParent(), a)
def test_setParent(self): a = self.newSysClock(tickRate=1000) b = CorrelatedClock(a, 1000, correlation=Correlation(0, 0)) c = CorrelatedClock(a, 1000, correlation=Correlation(10, 0)) d = MockDependent() b.bind(d) d.assertNotNotified() b.setParent(c) d.assertNotificationsEqual([b]) self.assertEquals(b.getParent(), c)
def test_getParent(self): b = self.newSysClock() c = CorrelatedClock(b, 1000, correlation=Correlation(50, 300)) self.assertEqual(c.getParent(), b)
def test_getParent(self): b = SysClock() c = CorrelatedClock(b, 1000, correlation=(50,300)) self.assertEqual(c.getParent(), b)