def test_session_from_identity_service(self):
    self.patch_object(api_crud, 'keystone_identity')
    self.patch_object(api_crud, 'keystone_session')
    identity_service = mock.MagicMock()
    result = api_crud.session_from_identity_service(identity_service)
    self.keystone_identity.Password.assert_called_once_with(auth_url='{}://{}:{}/'.format(identity_service.auth_protocol(), identity_service.auth_host(), identity_service.auth_port()), user_domain_name=identity_service.service_domain(), username=identity_service.service_username(), password=identity_service.service_password(), project_domain_name=identity_service.service_domain(), project_name=identity_service.service_tenant())
    self.keystone_session.Session.assert_called_once_with(auth=self.keystone_identity.Password(), verify='/etc/ssl/certs/ca-certificates.crt')
    self.assertEqual(result, self.keystone_session.Session())
def test_session_from_identity_service(self):
    self.patch_object(api_crud, 'keystone_identity')
    self.patch_object(api_crud, 'keystone_session')
    identity_service = mock.MagicMock()
    result = api_crud.session_from_identity_service(identity_service)
    self.keystone_identity.Password.assert_called_once_with(auth_url='{}://{}:{}/'.format(identity_service.auth_protocol(), identity_service.auth_host(), identity_service.auth_port()), user_domain_name=identity_service.service_domain(), username=identity_service.service_username(), password=identity_service.service_password(), project_domain_name=identity_service.service_domain(), project_name=identity_service.service_tenant())
    self.keystone_session.Session.assert_called_once_with(auth=self.keystone_identity.Password(), verify='/etc/ssl/certs/ca-certificates.crt')
    self.assertEqual(result, self.keystone_session.Session())