Add a test of the runroot hub plugin.

This commit is contained in:
Ralph Bean 2016-06-04 15:52:03 -04:00 committed by Mike McLean
parent 144a656148
commit b12905774f
3 changed files with 23 additions and 1 deletions

View file

@ -64,7 +64,7 @@ git-clean:
@git clean -d -q -x
test:
PYTHONPATH=hub/. nosetests --with-coverage --cover-package .
PYTHONPATH=hub/.:plugins/hub/. nosetests --with-coverage --cover-package .
subdirs:
for d in $(SUBDIRS); do make -C $$d; [ $$? = 0 ] || exit 1; done

View file

View file

@ -0,0 +1,22 @@
import unittest
import mock
import runroot_hub
class TestRunrootHub(unittest.TestCase):
@mock.patch('kojihub.make_task')
@mock.patch('runroot_hub.context')
def test_basic_invocation(self, context, make_task):
runroot_hub.runroot(
tagInfo='some_tag',
arch='x86_64',
command='ls',
)
make_task.assert_called_once_with(
'runroot',
('some_tag', 'x86_64', 'ls'),
priority=15,
arch='x86_64',
channel='runroot',
)