aboutsummaryrefslogtreecommitdiffstats
path: root/tests/_test_trapd_get_cbs_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/_test_trapd_get_cbs_config.py')
-rw-r--r--tests/_test_trapd_get_cbs_config.py44
1 files changed, 0 insertions, 44 deletions
diff --git a/tests/_test_trapd_get_cbs_config.py b/tests/_test_trapd_get_cbs_config.py
deleted file mode 100644
index 5fcfc2a..0000000
--- a/tests/_test_trapd_get_cbs_config.py
+++ /dev/null
@@ -1,44 +0,0 @@
-import pytest
-import unittest
-import os
-from onap_dcae_cbs_docker_client.client import get_config
-from trapd_exit import cleanup_and_exit
-from trapd_logging import stdout_logger
-import trapd_get_cbs_config
-
-class test_get_cbs_config(unittest.TestCase):
- """
- Test the trapd_get_cbs_config mod
- """
-
- def test_cbs_env_present(self):
- """
- Test that CBS env variable exists and we can get config even
- if CONSUL_HOST doesn't provide
- """
- os.environ.update(CONSUL_HOST='nosuchhost')
- result = trapd_get_cbs_config.trapd_get_cbs_config()
- compare = str(result).startswith("{'snmptrap': ")
- self.assertEqual(compare, False)
-
- def test_cbs_fallback_env_present(self):
- """
- Test that CBS fallback env variable exists and we can get config
- from fallback env var
- """
- os.environ.update(CBS_SIM_JSON='../etc/snmptrapd.json')
- result = trapd_get_cbs_config.trapd_get_cbs_config()
- compare = str(result).startswith("{'snmptrap': ")
- self.assertEqual(compare, False)
-
- def test_cbs_fallback_env_not_present(self):
- """
- Test that CBS fallback env variable does not exists fails
- """
- os.environ.update(CBS_SIM_JSON='../etc/no_such_file.json')
- result = trapd_get_cbs_config.trapd_get_cbs_config()
- compare = str(result).startswith("{'snmptrap': ")
- self.assertEqual(compare, False)
-
-if __name__ == '__main__':
- unittest.main()