diff options
author | Vijay VK <vv770d@att.com> | 2018-03-27 02:05:36 +0100 |
---|---|---|
committer | Ladue, David (dl3158) <dl3158@att.com> | 2018-03-28 00:08:38 -0400 |
commit | 339ca1c5d3c9f138a13ae82c181b001df43645eb (patch) | |
tree | 8e7685bad1508786503dad76073e418c1dfc19fe /tests/test_trapd_settings.py | |
parent | e0b9a69c01845eb32baaf9029b1775b81d78906f (diff) |
fix tox setup for snmptrap
Change-Id: I39adcd37cab64937af182c4716cba0cfaba6c7a2
Signed-off-by: VENKATESH KUMAR <vv770d@att.com>
Issue-ID: DCAEGEN2-271
Signed-off-by: VENKATESH KUMAR <vv770d@att.com>
Signed-off-by: Ladue, David (dl3158) <dl3158@att.com>
Diffstat (limited to 'tests/test_trapd_settings.py')
-rw-r--r-- | tests/test_trapd_settings.py | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/tests/test_trapd_settings.py b/tests/test_trapd_settings.py new file mode 100644 index 0000000..ab64426 --- /dev/null +++ b/tests/test_trapd_settings.py @@ -0,0 +1,73 @@ +import pytest +import unittest +import trapd_exit + +pid_file="/tmp/test_pid_file" +pid_file_dne="/tmp/test_pid_file_NOT" + +import trapd_settings as tds +from conftest import test_var + +class test_cleanup_and_exit(unittest.TestCase): + """ + Test for presense of required vars + """ + + + def test_nonexistent_dict(self): + """ + Test nosuch var + """ + tds.init() + try: + tds.no_such_var + result = True + except: + result = False + + self.assertEqual(result, False) + + def test_config_dict(self): + """ + Test config dict + """ + tds.init() + try: + tds.c_config + result = True + except: + result = False + + self.assertEqual(result, True) + + def test_dns_cache_ip_to_name(self): + """ + Test dns cache name dict + """ + + tds.init() + try: + tds.dns_cache_ip_to_name + result = True + except: + result = False + + self.assertEqual(result, True) + + def test_dns_cache_ip_expires(self): + """ + Test dns cache ip expires dict + """ + + tds.init() + try: + tds.dns_cache_ip_expires + result = True + except: + result = False + + self.assertEqual(result, True) + +if __name__ == '__main__': + # tds.init() + unittest.main() |