aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_trapd_http_session.py
diff options
context:
space:
mode:
authorLadue, David (dl3158) <dl3158@att.com>2018-08-22 17:01:59 -0400
committerLadue, David (dl3158) <dl3158@att.com>2018-08-22 17:02:15 -0400
commit701ab640f1d99f955ba0b14ae5bde49a3b7887f4 (patch)
treec6e3c8363b884a3043c70405b345dff73aebdd48 /tests/test_trapd_http_session.py
parent5f37a3be8fad7a2e795f508f7c216d679cebd28e (diff)
added test coverage
Change-Id: Ie8310bab09ce329e499263f07b3ab2d3a8969727 Issue-ID: DCAEGEN2-630 Signed-off-by: Ladue, David (dl3158) <dl3158@att.com>
Diffstat (limited to 'tests/test_trapd_http_session.py')
-rw-r--r--tests/test_trapd_http_session.py27
1 files changed, 25 insertions, 2 deletions
diff --git a/tests/test_trapd_http_session.py b/tests/test_trapd_http_session.py
index 8f61d08..a423be6 100644
--- a/tests/test_trapd_http_session.py
+++ b/tests/test_trapd_http_session.py
@@ -7,14 +7,37 @@ class test_init_session_obj(unittest.TestCase):
Test the init_session_obj mod
"""
- def test_correct_usage(self):
+ def init_session(self):
"""
- Test that attempt to create http session object works
+ test creation of http session
"""
result = trapd_http_session.init_session_obj()
compare = str(result).startswith("<requests.sessions.Session object at")
self.assertEqual(compare, True)
+ def test_reset(self):
+ """
+ test reset of existing http session
+ """
+ sess = trapd_http_session.init_session_obj()
+ result = trapd_http_session.reset_session_obj(sess)
+ compare = str(result).startswith("<requests.sessions.Session object at")
+ self.assertEqual(compare, True)
+
+ def close_existing_session(self):
+ """
+ test close of existing http session
+ """
+ sess = trapd_http_session.init_session_obj()
+ result = trapd_http_session.close_session_obj(sess)
+ self.assertEqual(result, True)
+
+ def close_nonexistent_session(self):
+ """
+ test close of non-existent http session
+ """
+ result = trapd_http_session.close_session_obj(None)
+ self.assertEqual(result, True)
if __name__ == '__main__':
unittest.main()