def test_request_id_header_session_client(self):
        global_id = "req-%s" % uuid.uuid4()
        kwargs = {'global_request_id': global_id}
        auth = token_endpoint.Token(self.endpoint, self.token)
        sess = session.Session(auth=auth)
        http_client = http.SessionClient(sess, **kwargs)

        path = '/v2/images/my-image'
        self.mock.get(self.endpoint + path)
        http_client.get(path)

        headers = self.mock.last_request.headers
        self.assertEqual(global_id, headers['X-OpenStack-Request-ID'])
示例#2
0
 def _create_session_client(self):
     auth = token_endpoint.Token(self.endpoint, self.token)
     sess = session.Session(auth=auth)
     return http.SessionClient(sess)