def test_set_invalid_delay(self): """Check if an exception is raised for invalid delay values""" with self.assertRaises(ValueError): scheduling_cfg = SchedulingTaskConfig(delay=5.0) scheduling_cfg = SchedulingTaskConfig(delay=5) with self.assertRaises(ValueError): scheduling_cfg.delay = 1.0 with self.assertRaises(ValueError): scheduling_cfg.delay = '1' self.assertEqual(scheduling_cfg.delay, 5)
def test_set_delay(self): """Test if delay property can be set""" scheduling_cfg = SchedulingTaskConfig(delay=5) self.assertEqual(scheduling_cfg.delay, 5) scheduling_cfg.delay = 1 self.assertEqual(scheduling_cfg.delay, 1)