Remove deprecated remove-channel/removeChannel
Fixes: https://pagure.io/koji/issue/3356
This commit is contained in:
parent
9a1ee191a6
commit
52026bcfcb
6 changed files with 0 additions and 183 deletions
|
|
@ -1,38 +0,0 @@
|
|||
import unittest
|
||||
|
||||
import mock
|
||||
|
||||
import koji
|
||||
import kojihub
|
||||
|
||||
UP = kojihub.UpdateProcessor
|
||||
|
||||
|
||||
class TestRemoveChannel(unittest.TestCase):
|
||||
def getUpdate(self, *args, **kwargs):
|
||||
update = UP(*args, **kwargs)
|
||||
update.execute = mock.MagicMock()
|
||||
self.updates.append(update)
|
||||
return update
|
||||
|
||||
def setUp(self):
|
||||
self.UpdateProcessor = mock.patch('kojihub.UpdateProcessor',
|
||||
side_effect=self.getUpdate).start()
|
||||
self.updates = []
|
||||
self.context = mock.patch('kojihub.context').start()
|
||||
self.context.session.assertPerm = mock.MagicMock()
|
||||
self.exports = kojihub.RootExports()
|
||||
self.channel_name = 'test-channel'
|
||||
|
||||
def tearDown(self):
|
||||
mock.patch.stopall()
|
||||
|
||||
@mock.patch('kojihub.get_channel_id')
|
||||
def test_non_exist_channel(self, get_channel_id):
|
||||
get_channel_id.side_effect = koji.GenericError('No such channel: %s' % self.channel_name)
|
||||
|
||||
with self.assertRaises(koji.GenericError):
|
||||
kojihub.remove_channel(self.channel_name)
|
||||
|
||||
get_channel_id.assert_called_once_with(self.channel_name, strict=True)
|
||||
self.assertEqual(len(self.updates), 0)
|
||||
Loading…
Add table
Add a link
Reference in a new issue