summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorRodolfo Carvalho <rhcarvalho@gmail.com>2017-03-27 15:08:10 +0200
committerRodolfo Carvalho <rhcarvalho@gmail.com>2017-03-28 11:54:52 +0200
commitca2eaab70716a23d1d8064d16d183cb7f2ffc898 (patch)
treec6d342816c02abf146e2bde74afe61e48be24e4f /roles
parent5acb711c3ebbb273351f1a1f3d418c85a6abf2c3 (diff)
downloadopenshift-ca2eaab70716a23d1d8064d16d183cb7f2ffc898.tar.gz
openshift-ca2eaab70716a23d1d8064d16d183cb7f2ffc898.tar.bz2
openshift-ca2eaab70716a23d1d8064d16d183cb7f2ffc898.tar.xz
openshift-ca2eaab70716a23d1d8064d16d183cb7f2ffc898.zip
Add unit tests for package_version.py
Diffstat (limited to 'roles')
-rw-r--r--roles/openshift_health_checker/test/package_version_test.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/roles/openshift_health_checker/test/package_version_test.py b/roles/openshift_health_checker/test/package_version_test.py
new file mode 100644
index 000000000..cc1d263bc
--- /dev/null
+++ b/roles/openshift_health_checker/test/package_version_test.py
@@ -0,0 +1,21 @@
+from openshift_checks.package_version import PackageVersion
+
+
+def test_package_version():
+ task_vars = dict(
+ openshift=dict(common=dict(service_type='origin')),
+ openshift_release='v3.5',
+ )
+ return_value = object()
+
+ def execute_module(module_name=None, module_args=None, tmp=None, task_vars=None):
+ assert module_name == 'aos_version'
+ assert 'prefix' in module_args
+ assert 'version' in module_args
+ assert module_args['prefix'] == task_vars['openshift']['common']['service_type']
+ assert module_args['version'] == task_vars['openshift_release']
+ return return_value
+
+ check = PackageVersion(execute_module=execute_module)
+ result = check.run(tmp=None, task_vars=task_vars)
+ assert result is return_value