summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZhongyue Luo <zhongyue.nah@intel.com>2013-11-22 08:37:21 +0800
committerZhongyue Luo <zhongyue.nah@intel.com>2013-11-22 08:37:21 +0800
commit83d5d2767410b60b21765215979ccdf471dc8bdc (patch)
tree7a543b4a96126f4e4ac45af5d0279f16b925883d /tests
parent808c051095e72b8a04c22cfc60d24ea43bb0ff43 (diff)
downloadoslo-middleware-83d5d2767410b60b21765215979ccdf471dc8bdc.tar.gz
Remove uuidutils imports in oslo modules
The only use of uuidutils in oslo-incubator is generate_uuid which could be replaced with uuid.uuid4(). Droping the dependency would help deprecating/removing uuidutils in the future. Partial-bug: #1253497 Change-Id: Ie0bc94e0b4aea6563f138c0f09c54c323ba23279
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/middleware/test_correlation_id.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/unit/middleware/test_correlation_id.py b/tests/unit/middleware/test_correlation_id.py
index f330ada..9a0d128 100644
--- a/tests/unit/middleware/test_correlation_id.py
+++ b/tests/unit/middleware/test_correlation_id.py
@@ -15,12 +15,13 @@
# License for the specific language governing permissions and limitations
# under the License.
+import uuid
+
import mock
from openstack.common.fixture import moxstubout
from openstack.common.middleware import correlation_id
from openstack.common import test
-from openstack.common import uuidutils
class CorrelationIdMiddlewareTest(test.BaseTestCase):
@@ -34,9 +35,9 @@ class CorrelationIdMiddlewareTest(test.BaseTestCase):
req = mock.Mock()
req.headers = {}
- mock_generate_uuid = mock.Mock()
- mock_generate_uuid.return_value = "fake_uuid"
- self.stubs.Set(uuidutils, 'generate_uuid', mock_generate_uuid)
+ mock_uuid4 = mock.Mock()
+ mock_uuid4.return_value = "fake_uuid"
+ self.stubs.Set(uuid, 'uuid4', mock_uuid4)
middleware = correlation_id.CorrelationIdMiddleware(app)
middleware(req)