diff options
author | OpenShift Bot <eparis+openshiftbot@redhat.com> | 2017-03-28 07:54:59 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-28 07:54:59 -0500 |
commit | e9a4e751bc28f43583087ce6502a36c5d83cf30d (patch) | |
tree | 9a5f816d8dd5c40d6b682fe514ce41fd4435d4cb /roles/openshift_health_checker/test/docker_image_availability_test.py | |
parent | 0d38f04595fc2098cf8304faf20e15e62f43955c (diff) | |
parent | d6cf72a4f488d8c275bfbaf27620ff716da1ae5d (diff) | |
download | openshift-e9a4e751bc28f43583087ce6502a36c5d83cf30d.tar.gz openshift-e9a4e751bc28f43583087ce6502a36c5d83cf30d.tar.bz2 openshift-e9a4e751bc28f43583087ce6502a36c5d83cf30d.tar.xz openshift-e9a4e751bc28f43583087ce6502a36c5d83cf30d.zip |
Merge pull request #3745 from rhcarvalho/checks-unit-tests
Merged by openshift-bot
Diffstat (limited to 'roles/openshift_health_checker/test/docker_image_availability_test.py')
-rw-r--r-- | roles/openshift_health_checker/test/docker_image_availability_test.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/roles/openshift_health_checker/test/docker_image_availability_test.py b/roles/openshift_health_checker/test/docker_image_availability_test.py new file mode 100644 index 000000000..2a9c32f77 --- /dev/null +++ b/roles/openshift_health_checker/test/docker_image_availability_test.py @@ -0,0 +1,28 @@ +import pytest + +from openshift_checks.docker_image_availability import DockerImageAvailability + + +@pytest.mark.xfail(strict=True) # TODO: remove this once this test is fully implemented. +@pytest.mark.parametrize('task_vars,expected_result', [ + ( + dict( + openshift=dict(common=dict( + service_type='origin', + is_containerized=False, + )), + openshift_release='v3.5', + deployment_type='origin', + openshift_image_tag='', # FIXME: should not be required + ), + {'changed': False}, + ), + # TODO: add more parameters here to test the multiple possible inputs that affect behavior. +]) +def test_docker_image_availability(task_vars, expected_result): + def execute_module(module_name=None, module_args=None, tmp=None, task_vars=None): + return {'info': {}} # TODO: this will vary depending on input parameters. + + check = DockerImageAvailability(execute_module=execute_module) + result = check.run(tmp=None, task_vars=task_vars) + assert result == expected_result |