From d5396cf35cd5d4b792d24590375401aa1177ad0e Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 19 Apr 2017 10:40:22 -0500 Subject: [PATCH] Strip trailing slashes in test helper method A recent patch by Rosario pointed out a flaw in get_mock_url. Luckily, it's an easy fix. Change-Id: Iff12fb36832a5757321bbcc36728b959899b45cd --- shade/tests/unit/base.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shade/tests/unit/base.py b/shade/tests/unit/base.py index 97b4b2f77..9f3913098 100644 --- a/shade/tests/unit/base.py +++ b/shade/tests/unit/base.py @@ -179,6 +179,9 @@ class RequestsMockTestCase(BaseTestCase): qs_elements=None): endpoint_url = self.cloud.endpoint_for( service_type=service_type, interface=interface) + # Strip trailing slashes, so as not to produce double-slashes below + if endpoint_url.endswith('/'): + endpoint_url = endpoint_url[:-1] to_join = [endpoint_url] qs = '' if base_url_append: