summaryrefslogtreecommitdiffstats
path: root/tests/test_trapd_http_session.py
diff options
context:
space:
mode:
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()