Exemplo n.º 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_rpm_delete_schedule_command(self):
        for action in SCHEDULE_INSTALL_ACTIONS:
            command = consumer_content.ConsumerContentDeleteScheduleCommand(
                self.context, action=action)

            self.assertTrue(isinstance(command, DeleteScheduleCommand))
            self.assertTrue(OPTION_CONSUMER_ID in command.options)
            self.assertEqual(command.name, 'delete')
            self.assertTrue(action in command.description)
Exemplo n.º 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))
Exemplo n.º 4
0
 def test_delete_schedule(self):
     try:
         consumer_content.ConsumerContentDeleteScheduleCommand(
             self.mock_context, self.action)
     except Exception, e:
         self.fail(str(e))