diff options
author | Rodolfo Carvalho <rhcarvalho@gmail.com> | 2017-03-27 15:08:10 +0200 |
---|---|---|
committer | Rodolfo Carvalho <rhcarvalho@gmail.com> | 2017-03-28 11:54:52 +0200 |
commit | ca2eaab70716a23d1d8064d16d183cb7f2ffc898 (patch) | |
tree | c6d342816c02abf146e2bde74afe61e48be24e4f /roles/openshift_health_checker | |
parent | 5acb711c3ebbb273351f1a1f3d418c85a6abf2c3 (diff) | |
download | openshift-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/openshift_health_checker')
-rw-r--r-- | roles/openshift_health_checker/test/package_version_test.py | 21 |
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 |