'Check that invalid substitutions raise warnings.'

def test_invalid_sensitive_substitution_in_domain_config(self):

    mock_log = mock.Mock()
    invalid_option_config = {'ldap': {'user_tree_dn': uuid.uuid4().hex, 'password': uuid.uuid4().hex}, 'identity': {'driver': uuid.uuid4().hex}}
    for invalid_option in ['my_url/%(passssword)s', 'my_url/%(password', 'my_url/%(password)', 'my_url/%(password)d']:
        invalid_option_config['ldap']['url'] = invalid_option
        self.domain_config_api.create_config(self.domain['id'], invalid_option_config)
        with mock.patch('keystone.resource.core.LOG', mock_log):
            res = self.domain_config_api.get_config_with_sensitive_info(self.domain['id'])
        mock_log.warning.assert_any_call(mock.ANY, mock.ANY)
        self.assertEqual(invalid_option_config['ldap']['url'], res['ldap']['url'])
