Esempio n. 1
0
class BaseRemoveCommandTests(PulpClientTests):
    def setUp(self):
        super(BaseRemoveCommandTests, self).setUp()

        self.command = BaseRemoveCommand(self.context, 'remove', 'base-remove', 'base-type')

    def test_structure(self):
        self.assertTrue(isinstance(self.command, UnitRemoveCommand))

    @mock.patch('pulp_rpm.extensions.admin.units_display.get_formatter_for_type')
    def test_get_formatter_for_type(self, mock_display):
        # Setup
        fake_units = 'u'
        fake_task = mock.MagicMock()
        fake_task.result = fake_units

        # Test
        self.command.get_formatter_for_type('foo-type')

        # Verify
        mock_display.assert_called_once_with('foo-type')
Esempio n. 2
0
class BaseRemoveCommandTests(PulpClientTests):
    def setUp(self):
        super(BaseRemoveCommandTests, self).setUp()

        self.command = BaseRemoveCommand(self.context, 'remove', 'base-remove',
                                         'base-type')

    def test_structure(self):
        self.assertTrue(isinstance(self.command, UnitRemoveCommand))

    @mock.patch(
        'pulp_rpm.extensions.admin.units_display.get_formatter_for_type')
    def test_get_formatter_for_type(self, mock_display):
        # Setup
        fake_units = 'u'
        fake_task = mock.MagicMock()
        fake_task.result = fake_units

        # Test
        self.command.get_formatter_for_type('foo-type')

        # Verify
        mock_display.assert_called_once_with('foo-type')
Esempio n. 3
0
    def setUp(self):
        super(BaseRemoveCommandTests, self).setUp()

        self.command = BaseRemoveCommand(self.context, 'remove', 'base-remove', 'base-type')
Esempio n. 4
0
    def setUp(self):
        super(BaseRemoveCommandTests, self).setUp()

        self.command = BaseRemoveCommand(self.context, 'remove', 'base-remove',
                                         'base-type')