def test_docker_arch_fail(self, container_module_args):
     container_module_args['content_type'] = 'Docker'
     container_module_args['arch'] = 'x86_64'
     set_module_args(container_module_args)
     with pytest.raises(AnsibleFailJson) as exit:
         main()
     result = exit.value.args[0]
     assert result['msg'] == 'arch must be "multi" for Docker repos'
 def test_docker_tps_fail(self, container_module_args):
     container_module_args['content_type'] = 'Docker'
     container_module_args['use_for_tps'] = True
     set_module_args(container_module_args)
     with pytest.raises(AnsibleFailJson) as ex:
         main()
     result = ex.value.args[0]
     assert result['msg'] == 'do not set "use_for_tps" for Docker repos'
 def test_default_arch(self, container_module_args, fake_ensure_cdn_repo,
                       content_type, expected):
     container_module_args['arch'] = None
     container_module_args['content_type'] = content_type
     set_module_args(container_module_args)
     with pytest.raises(AnsibleExitJson):
         main()
     _, _, params = fake_ensure_cdn_repo.args
     assert params['arch'] == expected
 def test_simple_rpms(self):
     module_args = {
         'name': 'rhceph-4-tools-for-rhel-8-x86_64-rpms',
         'release_type': 'Primary',
         'content_type': 'Binary',
         'use_for_tps': True,
         'arch': 'x86_64',
         'variants': ['8Base-RHCEPH-4.0-Tools', '8Base-RHCEPH-4.1-Tools'],
     }
     set_module_args(module_args)
     with pytest.raises(AnsibleExitJson) as exit:
         main()
     result = exit.value.args[0]
     assert result['changed'] is True
 def test_simple_container(self, container_module_args):
     set_module_args(container_module_args)
     with pytest.raises(AnsibleExitJson) as exit:
         main()
     result = exit.value.args[0]
     assert result['changed'] is True