Skip to content

Commit 8c11b0a

Browse files
committed
More testing
1 parent 1a4f0c5 commit 8c11b0a

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

ibw/client.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def create_session(self) -> bool:
114114
# more than likely it's running let's try and see if we can authenticate.
115115
auth_response = self.is_authenticated()
116116

117+
117118
if 'authenticated' in auth_response.keys() and auth_response['authenticated'] == True:
118119

119120
if self._set_server():
@@ -932,10 +933,6 @@ def update_server_account(self, account_id: str, check: bool = False) -> Dict:
932933

933934
content = self._make_request(endpoint = endpoint, req_type = req_type, params = params)
934935

935-
# if 'status_code' in content.keys():
936-
# time.sleep(1)
937-
# content = self._make_request(endpoint = endpoint, req_type = req_type, params = params)
938-
939936
return content
940937

941938

tests/unit/test_client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,18 @@ def test_create_session(self):
6666
session_response = self.ibw_client.create_session()
6767
self.assertTrue(session_response)
6868
self.assertTrue(self.ibw_client.authenticated)
69+
70+
def test_close_session(self):
71+
"""Test Closing the session."""
72+
73+
with self.assertRaises(SystemExit) as cm:
74+
self.ibw_client.close_session()
75+
self.assertEqual(cm.exception.code, 1)
6976

7077
def tearDown(self) -> None:
7178
"""Teardown the Session."""
7279

7380
self.ibw_client = None
7481

75-
7682
if __name__ == '__main__':
7783
unittest.main()

0 commit comments

Comments
 (0)