aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_trapd_get_cbs_config.py
diff options
context:
space:
mode:
authorLadue, David (dl3158) <dl3158@att.com>2019-03-21 18:30:01 -0400
committerLadue, David (dl3158) <dl3158@att.com>2019-03-21 18:32:56 -0400
commitdecf06eb401587c22ede29fbf3da958ac166a638 (patch)
tree8d13f36fd0a531dec329b82b9cb01063ec540b08 /tests/test_trapd_get_cbs_config.py
parent8e12680f279f50fc7a1ca01e66c003f6059ae754 (diff)
increase pytest coverage4.0.0-ONAPdublin
Change-Id: I871f5fc3182e0a21b3b4c6d6e033abf8730c8d10 Issue-ID: DCAEGEN2-1264 Signed-off-by: Ladue, David (dl3158) <dl3158@att.com>
Diffstat (limited to 'tests/test_trapd_get_cbs_config.py')
-rw-r--r--tests/test_trapd_get_cbs_config.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_trapd_get_cbs_config.py b/tests/test_trapd_get_cbs_config.py
index accb986..44bf021 100644
--- a/tests/test_trapd_get_cbs_config.py
+++ b/tests/test_trapd_get_cbs_config.py
@@ -54,6 +54,21 @@ class test_get_cbs_config(unittest.TestCase):
assert pytest_wrapped_sys_exit.value.code == 1
+ def test_cbs_override_env_unset(self):
+ """
+ """
+ os.environ.update(CBS_SIM_JSON='')
+ #result = trapd_get_cbs_config.get_cbs_config()
+ #print("result: %s" % result)
+ # compare = str(result).startswith("{'snmptrap': ")
+ # self.assertEqual(compare, False)
+
+ with pytest.raises(SystemExit) as pytest_wrapped_sys_exit:
+ result = trapd_get_cbs_config.get_cbs_config()
+ assert pytest_wrapped_sys_exit.type == SystemExit
+ assert pytest_wrapped_sys_exit.value.code == 1
+
+
def test_cbs_fallback_env_present(self):
"""
Test that CBS fallback env variable exists and we can get config