summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker
diff options
context:
space:
mode:
authorRodolfo Carvalho <rhcarvalho@gmail.com>2017-03-27 14:58:13 +0200
committerRodolfo Carvalho <rhcarvalho@gmail.com>2017-03-28 11:54:52 +0200
commit5acb711c3ebbb273351f1a1f3d418c85a6abf2c3 (patch)
tree5a7d005d4f23e66d3ed3b9089b347299faa935d4 /roles/openshift_health_checker
parenta39620a07602db95d0d59702a9a5466b270a2be8 (diff)
downloadopenshift-5acb711c3ebbb273351f1a1f3d418c85a6abf2c3.tar.gz
openshift-5acb711c3ebbb273351f1a1f3d418c85a6abf2c3.tar.bz2
openshift-5acb711c3ebbb273351f1a1f3d418c85a6abf2c3.tar.xz
openshift-5acb711c3ebbb273351f1a1f3d418c85a6abf2c3.zip
Add unit tests for package_update.py
Diffstat (limited to 'roles/openshift_health_checker')
-rw-r--r--roles/openshift_health_checker/test/package_update_test.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/roles/openshift_health_checker/test/package_update_test.py b/roles/openshift_health_checker/test/package_update_test.py
new file mode 100644
index 000000000..5e000cff5
--- /dev/null
+++ b/roles/openshift_health_checker/test/package_update_test.py
@@ -0,0 +1,16 @@
+from openshift_checks.package_update import PackageUpdate
+
+
+def test_package_update():
+ return_value = object()
+
+ def execute_module(module_name=None, module_args=None, tmp=None, task_vars=None):
+ assert module_name == 'check_yum_update'
+ assert 'packages' in module_args
+ # empty list of packages means "generic check if 'yum update' will work"
+ assert module_args['packages'] == []
+ return return_value
+
+ check = PackageUpdate(execute_module=execute_module)
+ result = check.run(tmp=None, task_vars=None)
+ assert result is return_value