summaryrefslogtreecommitdiffstats
path: root/roles/openshift_health_checker/test/docker_image_availability_test.py
blob: 2a9c32f7787f5bd3eab943c34c9a8520a2eec505 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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