summaryrefslogtreecommitdiffstats
path: root/onap-dcae-cbs-docker-client/tests
diff options
context:
space:
mode:
authorTommy Carpenter <tommy@research.att.com>2018-03-12 11:29:33 -0400
committerTommy Carpenter <tommy@research.att.com>2018-03-12 11:29:37 -0400
commit426fd9d38a43df7efb46acb38412a76788c43110 (patch)
tree714cd858ce15abf5954ba8923831d33a60bbdd10 /onap-dcae-cbs-docker-client/tests
parent7ed337600a48307f368849da028d772f06e387e0 (diff)
PEP8 Compliance
Change-Id: I93935004dabebdb9cb1b917e5f9e462aef46cb40 Issue-ID: DCAEGEN2-348 Signed-off-by: Tommy Carpenter <tommy@research.att.com>
Diffstat (limited to 'onap-dcae-cbs-docker-client/tests')
-rw-r--r--onap-dcae-cbs-docker-client/tests/test_client.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/onap-dcae-cbs-docker-client/tests/test_client.py b/onap-dcae-cbs-docker-client/tests/test_client.py
index 8512fad..dd6ab10 100644
--- a/onap-dcae-cbs-docker-client/tests/test_client.py
+++ b/onap-dcae-cbs-docker-client/tests/test_client.py
@@ -17,17 +17,21 @@
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
from onap_dcae_cbs_docker_client.client import get_config, get_all
+
class FakeResponse:
def __init__(self, status_code, thejson):
self.status_code = status_code
self.thejson = thejson
+
def raise_for_status(self):
pass
+
def json(self):
return self.thejson
+
def monkeyed_requests_get(url):
- #mock all the get calls for existent and non-existent
+ # mock all the get calls for existent and non-existent
if url == "http://consuldotcom:8500/v1/catalog/service/config_binding_service":
return FakeResponse(status_code=200,
thejson=[{"ServiceAddress": "666.666.666.666",
@@ -49,6 +53,7 @@ def test_config(monkeypatch):
monkeypatch.setattr('requests.get', monkeyed_requests_get)
assert(get_config() == {"key_to_your_heart": 666})
+
def test_all(monkeypatch):
monkeypatch.setattr('requests.get', monkeyed_requests_get)
assert(get_all() == {"config": {"key_to_your_heart": 666},