diff options
author | Tommy Carpenter <tommy@research.att.com> | 2019-06-24 15:52:59 +0000 |
---|---|---|
committer | Tommy Carpenter <tommy@research.att.com> | 2019-06-24 17:22:59 +0000 |
commit | 1474cbb0aec7a0636d4d53ad09eba501d9c75458 (patch) | |
tree | b24ac03546c2ddf352b29a4ac4a60363a808edbf /onap-dcae-cbs-docker-client/tests/test_client.py | |
parent | 6778c62c6f9bfb7f6dc0123f268eb3f4e960b847 (diff) |
Add CBS https/tls support
Issue-ID: DCAEGEN2-1551
Change-Id: I657d13ec87e051bd4836bd4c42385a580eaebe01
Signed-off-by: Tommy Carpenter <tommy@research.att.com>
Diffstat (limited to 'onap-dcae-cbs-docker-client/tests/test_client.py')
-rw-r--r-- | onap-dcae-cbs-docker-client/tests/test_client.py | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/onap-dcae-cbs-docker-client/tests/test_client.py b/onap-dcae-cbs-docker-client/tests/test_client.py index b1589c2..132ab33 100644 --- a/onap-dcae-cbs-docker-client/tests/test_client.py +++ b/onap-dcae-cbs-docker-client/tests/test_client.py @@ -18,13 +18,29 @@ from onap_dcae_cbs_docker_client.client import get_config, get_all from onap_dcae_cbs_docker_client.exceptions import CantGetConfig, CBSUnreachable, ENVsMissing -def test_config(monkeypatch, monkeyed_requests_get): +def test_http(monkeypatch, monkeyed_requests_get): monkeypatch.setattr("requests.get", monkeyed_requests_get) + assert get_config() == {"key_to_your_heart": 666} + assert get_all() == { + "config": {"key_to_your_heart": 666}, + "dti": {"some amazing": "dti stuff"}, + "policies": {"event": {"foo": "bar"}, "items": [{"foo2": "bar2"}]}, + "otherkey": {"foo3": "bar3"}, + } + + +def test_https_url(monkeypatch, monkeyed_requests_get_https): + """ + this doesn't really test https; because of all the cert stuff, + however it tests that the url gets formed correctly in the presence of this env variable + """ + monkeypatch.setattr("requests.get", monkeyed_requests_get_https) + monkeypatch.setenv("DCAE_CA_CERTPATH", "1") + + assert get_config() == {"key_to_your_heart": 666} -def test_all(monkeypatch, monkeyed_requests_get): - monkeypatch.setattr("requests.get", monkeyed_requests_get) assert get_all() == { "config": {"key_to_your_heart": 666}, "dti": {"some amazing": "dti stuff"}, |