def _ansible_config_test(self, load_facts_mock, run_ansible_mock,
        installer_config, ansible_config_cli=None, expected_result=None):
        """
        Utility method for testing the ways you can specify the ansible config.
        """

        load_facts_mock.return_value = (MOCK_FACTS, 0)
        run_ansible_mock.return_value = 0

        config_file = self.write_config(os.path.join(self.work_dir,
            'ooinstall.conf'), installer_config)

        self.cli_args.extend(["-c", config_file])
        if ansible_config_cli:
            self.cli_args.extend(["--ansible-config", ansible_config_cli])
        self.cli_args.append("install")
        result = self.runner.invoke(cli.cli, self.cli_args)
        self.assert_result(result, 0)

        # Test the env vars for facts playbook:
        facts_env_vars = load_facts_mock.call_args[0][2]
        if expected_result:
            self.assertEquals(expected_result, facts_env_vars['ANSIBLE_CONFIG'])
        else:
            # If user running test has rpm installed, this might be set to default:
            self.assertTrue('ANSIBLE_CONFIG' not in facts_env_vars or
                facts_env_vars['ANSIBLE_CONFIG'] == cli.DEFAULT_ANSIBLE_CONFIG)

        # Test the env vars for main playbook:
        env_vars = run_ansible_mock.call_args[0][2]
        if expected_result:
            self.assertEquals(expected_result, env_vars['ANSIBLE_CONFIG'])
        else:
            # If user running test has rpm installed, this might be set to default:
            self.assertTrue(env_vars not in 'ANSIBLE_CONFIG' or
                env_vars['ANSIBLE_CONFIG'] == cli.DEFAULT_ANSIBLE_CONFIG)

    # unattended with bad config file and no installed hosts (without --force)
dataset/ETHPy150Open openshift/openshift-ansible/utils/test/cli_installer_tests.py/UnattendedCliTests._ansible_config_test/swapped operands of `not in`