Exemple #1
0
    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_content_list_schedule_command(self):
        for action in SCHEDULE_INSTALL_ACTIONS:
            command = consumer_content.ConsumerContentListScheduleCommand(
                self.context, action=action)

            self.assertTrue(isinstance(command, ListScheduleCommand))
            self.assertTrue(OPTION_CONSUMER_ID in command.options)
            self.assertEqual(command.name, 'list')
            self.assertTrue(action in command.description)
Exemple #3
0
    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_list_schedule(self):
     try:
         consumer_content.ConsumerContentListScheduleCommand(
             self.mock_context, self.action)
     except Exception, e:
         self.fail(str(e))