Adding unit test to validate new except block
@@ -869,6 +869,13 @@ class ConnectionTest(unittest.TestCase):
self.assertEqual(self.connection.get_session_id(), '123')
self.assertEqual(self.connection.get_session(), True)
+ @patch.object(connection, 'get')
+ def test_login_catches_exceptions_as_hpOneView(self, mock_get):
+ mock_get.side_effect = [Exception('test')]
+
+ with self.assertRaises(HPOneViewException):
+ self.connection.login({})
+
@patch.object(connection, 'get')
@patch.object(connection, 'post')
def test_login_with_exception_in_post(self, mock_post, mock_get):
