parent
87aa8eb17b
commit
d67c36151b
27 changed files with 84 additions and 71 deletions
|
|
@ -152,22 +152,9 @@ class TestRunrootHub(unittest.TestCase):
|
|||
@mock.patch('kojihub.get_tag')
|
||||
@mock.patch('kojihub.make_task')
|
||||
@mock.patch('runroot_hub.context')
|
||||
def test_non_exist_channel(self, context, make_task, get_tag, get_channel):
|
||||
def test_command_wrong_format(self, context, make_task, get_tag, get_channel):
|
||||
context.session.assertPerm = mock.MagicMock()
|
||||
get_channel.side_effect = koji.GenericError
|
||||
with self.assertRaises(koji.GenericError):
|
||||
runroot_hub.runroot(tagInfo='some_tag', arch='x86_64', command='ls',
|
||||
channel='non-exist-channel')
|
||||
make_task.assert_not_called()
|
||||
get_tag.assert_not_called()
|
||||
|
||||
@mock.patch('kojihub.get_channel')
|
||||
@mock.patch('kojihub.get_tag')
|
||||
@mock.patch('kojihub.make_task')
|
||||
@mock.patch('runroot_hub.context')
|
||||
def test_commang_wrong_format(self, context, make_task, get_tag, get_channel):
|
||||
context.session.assertPerm = mock.MagicMock()
|
||||
command = ['ls']
|
||||
command = {'ls'}
|
||||
with self.assertRaises(koji.GenericError) as ex:
|
||||
runroot_hub.runroot(tagInfo='some_tag', arch='x86_64', command=command,
|
||||
channel='non-exist-channel')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue