summaryrefslogtreecommitdiffstats
path: root/dcae-cli/dcae_cli/util/tests/test_discovery.py
diff options
context:
space:
mode:
authorLusheng Ji <lji@research.att.com>2018-03-19 16:10:52 +0000
committerGerrit Code Review <gerrit@onap.org>2018-03-19 16:10:52 +0000
commitc1be0395714dc7448e8acd262d60c5312c6889e5 (patch)
treed1da64cf6f1581def729da47d57ad79409938b30 /dcae-cli/dcae_cli/util/tests/test_discovery.py
parentfbd0d3f76fa27fbb5a915891da823de9dca3862e (diff)
parentb1d8f1d4889a8e1e8207cfabea8040ce9cb76ac2 (diff)
Merge "Fix issue where getting empty consul in discovery"2.0.0-ONAPbeijing2.0.0-ONAP
Diffstat (limited to 'dcae-cli/dcae_cli/util/tests/test_discovery.py')
-rw-r--r--dcae-cli/dcae_cli/util/tests/test_discovery.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/dcae-cli/dcae_cli/util/tests/test_discovery.py b/dcae-cli/dcae_cli/util/tests/test_discovery.py
index b37ac17..2148ea3 100644
--- a/dcae-cli/dcae_cli/util/tests/test_discovery.py
+++ b/dcae-cli/dcae_cli/util/tests/test_discovery.py
@@ -433,6 +433,15 @@ def test_apply_inputs():
assert updated_config == {"foo": "baz"}
+def test_choose_consul_host(monkeypatch):
+ def fake_default_consul_host():
+ return "default-consul-host"
+
+ monkeypatch.setattr(dis, "default_consul_host", fake_default_consul_host)
+ assert "default-consul-host" == dis._choose_consul_host(None)
+ assert "provided-consul-host" == dis._choose_consul_host("provided-consul-host")
+
+
if __name__ == '__main__':
'''Test area'''
pytest.main([__file__, ])