# Path: oslo_middleware/request_id.py
# ENV_REQUEST_ID = 'openstack.request_id'
# GLOBAL_REQ_ID = 'openstack.global_request_id'
# HTTP_RESP_HEADER_REQUEST_ID = 'x-openstack-request-id'
# INBOUND_HEADER = 'X-Openstack-Request-Id'
# ID_FORMAT = (r'^req-[a-f0-9]{8}-[a-f0-9]{4}-'
#              r'[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$')
# class RequestId(base.ConfigurableMiddleware):
#     def set_global_req_id(self, req):
#     def __call__(self, req):


import uuid
import webob
import webob.dec
from oslotest import base as test_base
from testtools import matchers
from oslo_middleware import request_id
# Copyright (c) 2013 NEC Corporation
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.





class AltHeader(request_id.RequestId):
    compat_headers = ["x-compute-req-id", "x-silly-id"]


class RequestIdTest(test_base.BaseTestCase):
    def test_generate_request_id(self):
        @webob.dec.wsgify
        def application(req):
            return req.environ[request_id.ENV_REQUEST_ID]


# Path: oslo_middleware/request_id.py
# ENV_REQUEST_ID = 'openstack.request_id'
# GLOBAL_REQ_ID = 'openstack.global_request_id'
# HTTP_RESP_HEADER_REQUEST_ID = 'x-openstack-request-id'
# INBOUND_HEADER = 'X-Openstack-Request-Id'
# ID_FORMAT = (r'^req-[a-f0-9]{8}-[a-f0-9]{4}-'
#              r'[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$')
# class RequestId(base.ConfigurableMiddleware):
#     def set_global_req_id(self, req):
#     def __call__(self, req):


# Path: oslo_middleware/tests/test_request_id.py
import uuid
import webob
import webob.dec
from oslotest import base as test_base
from testtools import matchers
from oslo_middleware import request_id

# Copyright (c) 2013 NEC Corporation
# All Rights Reserved.
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.





class AltHeader(request_id.RequestId):
    compat_headers = ["x-compute-req-id", "x-silly-id"]


class RequestIdTest(test_base.BaseTestCase):
    def test_generate_request_id(self):
        @webob.dec.wsgify
        def application(req):
            return req.environ[request_id.ENV_REQUEST_ID]


        app = request_id.RequestId(application)