

@mock.patch('keystoneclient.v3.client.Client')
@expected_kwargs.patch('mistralclient.api.httpclient.HTTPClient')
def test_mistral_url_https_secure(self, mock, keystone_client_mock):
    (fd, path) = tempfile.mkstemp(suffix='.pem')
    keystone_client_instance = keystone_client_mock.return_value
    keystone_client_instance.auth_token = str(uuid.uuid4())
    keystone_client_instance.project_id = str(uuid.uuid4())
    keystone_client_instance.user_id = str(uuid.uuid4())
    expected_args = (MISTRAL_HTTPS_URL, keystone_client_instance.auth_token, keystone_client_instance.project_id, keystone_client_instance.user_id)
    expected_kwargs = {
        'cacert': path,
        'insecure': False,
    }
    try:
        client.client(mistral_url=MISTRAL_HTTPS_URL, username='mistral', project_name='mistral', auth_url=AUTH_HTTP_URL, cacert=path, insecure=False)
    finally:
        os.close(fd)
        os.unlink(path)
    self.assertTrue(mock.called)
    self.assertEqual(mock.call_args[0], expected_args)
    self.assertDictEqual(mock.call_args[1], expected_kwargs)

dataset/ETHPy150Open openstack/python-mistralclient/mistralclient/tests/unit/test_client.py BaseClientTests.test_mistral_url_https_secure/VarMisuse@11/22 `mock`->`expected_kwargs`