diff --git a/tests/test_etcd.py b/tests/test_etcd.py index 8f2280e6..1f280534 100644 --- a/tests/test_etcd.py +++ b/tests/test_etcd.py @@ -12,6 +12,7 @@ class MockResponse: def __init__(self): self.status_code = 200 self.content = '{}' + self.ok = True def json(self): return json.loads(self.content) @@ -34,6 +35,9 @@ def requests_get(url, **kwargs): response.status_code = 404 elif url.startswith('http://noleader'): response.content = '{"action":"get","node":{"key":"/service/batman5","dir":true,"nodes":[{"key":"/service/batman5/initialize","value":"postgresql0","modifiedIndex":1582,"createdIndex":1582},{"key":"/service/batman5/leader","value":"postgresql1","expiration":"2015-05-15T09:11:00.037397538Z","ttl":21,"modifiedIndex":20728,"createdIndex":20434},{"key":"/service/batman5/optime","dir":true,"nodes":[{"key":"/service/batman5/optime/leader","value":"2164261704","modifiedIndex":20729,"createdIndex":20729}],"modifiedIndex":20437,"createdIndex":20437},{"key":"/service/batman5/members","dir":true,"nodes":[{"key":"/service/batman5/members/postgresql0","value":"postgres://replicator:rep-pass@127.0.0.1:5433/postgres","expiration":"2015-05-15T09:11:09.611860899Z","ttl":30,"modifiedIndex":20730,"createdIndex":20730}],"modifiedIndex":1581,"createdIndex":1581}],"modifiedIndex":1581,"createdIndex":1581}}' + else: + response.status_code = 404 + response.ok = False return response