docker_image_availability_test.py 1.1 KB

12345678910111213141516171819202122232425262728
  1. import pytest
  2. from openshift_checks.docker_image_availability import DockerImageAvailability
  3. @pytest.mark.xfail(strict=True) # TODO: remove this once this test is fully implemented.
  4. @pytest.mark.parametrize('task_vars,expected_result', [
  5. (
  6. dict(
  7. openshift=dict(common=dict(
  8. service_type='origin',
  9. is_containerized=False,
  10. )),
  11. openshift_release='v3.5',
  12. deployment_type='origin',
  13. openshift_image_tag='', # FIXME: should not be required
  14. ),
  15. {'changed': False},
  16. ),
  17. # TODO: add more parameters here to test the multiple possible inputs that affect behavior.
  18. ])
  19. def test_docker_image_availability(task_vars, expected_result):
  20. def execute_module(module_name=None, module_args=None, tmp=None, task_vars=None):
  21. return {'info': {}} # TODO: this will vary depending on input parameters.
  22. check = DockerImageAvailability(execute_module=execute_module)
  23. result = check.run(tmp=None, task_vars=task_vars)
  24. assert result == expected_result