Example #1
0
    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)
Example #2
0
    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)
Example #3
0
 def test_getParent(self):
     b = self.newSysClock()
     c = CorrelatedClock(b, 1000, correlation=Correlation(50, 300))
     self.assertEqual(c.getParent(), b)
Example #4
0
 def test_getParent(self):
     b = SysClock()
     c = CorrelatedClock(b, 1000, correlation=(50,300))
     self.assertEqual(c.getParent(), b)