def __init__(self, context, action): description = _('manage consumer package %s schedules' % action) super(YumConsumerSchedulesSection, self).__init__('schedules', description) self.add_command(consumer_content.ConsumerContentListScheduleCommand(context, action)) self.add_command(YumConsumerContentCreateScheduleCommand(context, action, TYPE_ID_RPM)) self.add_command(consumer_content.ConsumerContentDeleteScheduleCommand(context, action)) self.add_command(consumer_content.ConsumerContentUpdateScheduleCommand(context, action)) self.add_command(consumer_content.ConsumerContentNextRunCommand(context, action))
def test_rpm_update_schedule_command(self): for action in SCHEDULE_INSTALL_ACTIONS: command = consumer_content.ConsumerContentUpdateScheduleCommand( self.context, action=action) self.assertTrue(isinstance(command, UpdateScheduleCommand)) self.assertTrue(OPTION_CONSUMER_ID in command.options) self.assertEqual(command.name, 'update') self.assertTrue(action in command.description)
def __init__(self, context, action): description = _('manage consumer errata %s schedules' % action) super(self.__class__, self).__init__('schedules', description) self.add_command(consumer_content.ConsumerContentListScheduleCommand(context, action)) self.add_command(YumConsumerContentCreateScheduleCommand(context, action, TYPE_ID_ERRATA)) self.add_command(consumer_content.ConsumerContentDeleteScheduleCommand(context, action)) self.add_command(consumer_content.ConsumerContentUpdateScheduleCommand(context, action)) self.add_command(consumer_content.ConsumerContentNextRunCommand(context, action))
def test_update_schedule(self): try: consumer_content.ConsumerContentUpdateScheduleCommand( self.mock_context, self.action) except Exception, e: self.fail(str(e))