X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=functest%2Futils%2Fdecorators.py;h=230a99e75c8e9379696b31827ab420b153ca710e;hb=2cfa22a0d0aa86cee5d77707c2f06ef3c4434a14;hp=bfbdf048d33d31ab415050b89b57dc644d638098;hpb=1aa8e1bc1f428921e3fbfb8feca4ea4de5d7019e;p=functest.git diff --git a/functest/utils/decorators.py b/functest/utils/decorators.py index bfbdf048d..230a99e75 100644 --- a/functest/utils/decorators.py +++ b/functest/utils/decorators.py @@ -1,21 +1,28 @@ #!/usr/bin/env python +# Copyright (c) 2017 Orange and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 + # pylint: disable=missing-docstring import errno import functools import os -import urlparse import mock import requests.sessions +from six.moves import urllib def can_dump_request_to_file(method): def dump_preparedrequest(request, **kwargs): # pylint: disable=unused-argument - parseresult = urlparse.urlparse(request.url) + parseresult = urllib.parse.urlparse(request.url) if parseresult.scheme == "file": try: dirname = os.path.dirname(parseresult.path) @@ -34,7 +41,7 @@ def can_dump_request_to_file(method): def patch_request(method, url, **kwargs): with requests.sessions.Session() as session: - parseresult = urlparse.urlparse(url) + parseresult = urllib.parse.urlparse(url) if parseresult.scheme == "file": with mock.patch.object(session, 'send', side_effect=dump_preparedrequest):