You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2019/05/26 16:11:34 UTC
[libcloud] 02/03: Fix a bug with ECS tests using wrong hostname
which caused tests to fail on Travis with newer version of requests.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 8f0ad037412952762c915bc4d9ad973c9d1e7c9d
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Sun May 26 17:41:08 2019 +0200
Fix a bug with ECS tests using wrong hostname which caused tests to fail
on Travis with newer version of requests.
---
libcloud/test/container/test_ecs.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/libcloud/test/container/test_ecs.py b/libcloud/test/container/test_ecs.py
index 59956d8..3699a1a 100644
--- a/libcloud/test/container/test_ecs.py
+++ b/libcloud/test/container/test_ecs.py
@@ -188,9 +188,13 @@ class ECSMockHttp(MockHttp):
'GetAuthorizationToken': 'getauthorizationtoken.json'
}
- def root(
- self, method, url, body, headers):
+ def root(self, method, url, body, headers):
target = headers['x-amz-target']
+
+ # Workaround for host not being correctly set for the tests
+ if '%s' in self.host:
+ self.host = self.host % ('region')
+
if target is not None:
type = target.split('.')[-1]
if type is None or self.fixture_map.get(type) is None: