From a9134fb37b2c0569f538beb61490ddec692781f3 Mon Sep 17 00:00:00 2001 From: Vladimir Stepanov <48280294+vstepanov-lohika-tix@users.noreply.github.com> Date: Fri, 15 Nov 2019 15:09:37 +0200 Subject: [PATCH] Revert "update build_url function in Locust HttpSession " --- locust/clients.py | 6 +++--- locust/test/test_client.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/locust/clients.py b/locust/clients.py index 4b76a60d4d..252d97362c 100644 --- a/locust/clients.py +++ b/locust/clients.py @@ -8,7 +8,7 @@ from requests.exceptions import (InvalidSchema, InvalidURL, MissingSchema, RequestException) -from six.moves.urllib.parse import urlparse, urlunparse, urljoin +from six.moves.urllib.parse import urlparse, urlunparse from . import events from .exception import CatchResponseError, ResponseError @@ -69,8 +69,8 @@ def _build_url(self, path): if absolute_http_url_regexp.match(path): return path else: - return urljoin(self.base_url, path) - + return "%s%s" % (self.base_url, path) + def request(self, method, url, name=None, catch_response=False, **kwargs): """ Constructs and sends a :py:class:`requests.Request`. diff --git a/locust/test/test_client.py b/locust/test/test_client.py index d8b6864988..afd2da6cd7 100644 --- a/locust/test/test_client.py +++ b/locust/test/test_client.py @@ -23,8 +23,8 @@ def test_connection_error(self): def test_wrong_url(self): for url, exception in ( (u"http://\x94", InvalidURL), - ("telnet://127.0.0.1", MissingSchema), - ("127.0.0.1", MissingSchema), + ("telnet://127.0.0.1", InvalidSchema), + ("127.0.0.1", MissingSchema), ): s = HttpSession(url) try: