X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=functest%2Futils%2Fdecorators.py;h=230a99e75c8e9379696b31827ab420b153ca710e;hb=16a0d65806ca7bdb166e3d8535185a82b45ae7ff;hp=bfbdf048d33d31ab415050b89b57dc644d638098;hpb=10ed30e26e9510dcdc9563a0eda3b94c0ccb16ad;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):