From b12905774f6cd64aa99fc5d17c95bc0ad01f738a Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Sat, 4 Jun 2016 15:52:03 -0400 Subject: [PATCH] Add a test of the runroot hub plugin. --- Makefile | 2 +- tests/test_plugins/__init__.py | 0 tests/test_plugins/test_runroot_hub.py | 22 ++++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 tests/test_plugins/__init__.py create mode 100644 tests/test_plugins/test_runroot_hub.py diff --git a/Makefile b/Makefile index beea79ca..09db069a 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/tests/test_plugins/__init__.py b/tests/test_plugins/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_plugins/test_runroot_hub.py b/tests/test_plugins/test_runroot_hub.py new file mode 100644 index 00000000..97fd1cfe --- /dev/null +++ b/tests/test_plugins/test_runroot_hub.py @@ -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', + )