def test_set_invalid_max_retries(self): """Check if an exception is raised for invalid max_retries values""" with self.assertRaises(ValueError): scheduling_cfg = SchedulingTaskConfig(max_retries=2.0) scheduling_cfg = SchedulingTaskConfig(max_retries=3) with self.assertRaises(ValueError): scheduling_cfg.max_retries = 5.0 with self.assertRaises(ValueError): scheduling_cfg.max_retries = '5' self.assertEqual(scheduling_cfg.max_retries, 3)
def test_set_max_retries(self): """Test if max_retries property can be set""" scheduling_cfg = SchedulingTaskConfig(max_retries=3) self.assertEqual(scheduling_cfg.max_retries, 3) scheduling_cfg.max_retries = 1 self.assertEqual(scheduling_cfg.max_retries, 1)