Add a test of the runroot hub plugin.
This commit is contained in:
parent
144a656148
commit
b12905774f
3 changed files with 23 additions and 1 deletions
2
Makefile
2
Makefile
|
|
@ -64,7 +64,7 @@ git-clean:
|
||||||
@git clean -d -q -x
|
@git clean -d -q -x
|
||||||
|
|
||||||
test:
|
test:
|
||||||
PYTHONPATH=hub/. nosetests --with-coverage --cover-package .
|
PYTHONPATH=hub/.:plugins/hub/. nosetests --with-coverage --cover-package .
|
||||||
|
|
||||||
subdirs:
|
subdirs:
|
||||||
for d in $(SUBDIRS); do make -C $$d; [ $$? = 0 ] || exit 1; done
|
for d in $(SUBDIRS); do make -C $$d; [ $$? = 0 ] || exit 1; done
|
||||||
|
|
|
||||||
0
tests/test_plugins/__init__.py
Normal file
0
tests/test_plugins/__init__.py
Normal file
22
tests/test_plugins/test_runroot_hub.py
Normal file
22
tests/test_plugins/test_runroot_hub.py
Normal 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',
|
||||||
|
)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue