def test_rate(): rt1 = cyber_time.Rate(111) rt2 = cyber_time.Rate(0.2) rt3 = cyber_time.Rate(cyber_time.Duration(666)) print(rt1) print(rt2) print(rt3)
def test_rate(self): rt1 = cyber_time.Rate(111) self.assertEqual(0, rt1.get_cycle_time().to_nsec()) self.assertEqual(111, rt1.get_expected_cycle_time().to_nsec()) rt2 = cyber_time.Rate(0.2) self.assertEqual(0, rt2.get_cycle_time().to_nsec()) self.assertEqual(5, rt2.get_expected_cycle_time().to_nsec()) rt3 = cyber_time.Rate(cyber_time.Duration(666)) self.assertEqual(0, rt3.get_cycle_time().to_nsec()) self.assertEqual(666, rt3.get_expected_cycle_time().to_nsec())