def close(self): """Closes a connection with MicroStrategy REST API.""" authentication.logout(connection=self) self.session.close() if config.verbose: print("Connection to MicroStrategy Intelligence Server has been closed")
def close(self): """Closes a connection with MicroStrategy REST API""" authentication.logout(connection=self, verbose=helper.debug()) if self.verbose: print( "Connection to MicroStrategy Intelligence Server has been closed" )
def close(self): """Closes a connection with MicroStrategy REST API.""" authentication.logout(connection=self, whitelist=[('ERR009', 401)]) self._session.close() self.token = None if config.verbose: logger.info( 'Connection to MicroStrategy Intelligence Server has been closed.' )
def test_logout(self, mock_post): conn = microstrategy.Connection(base_url=BASE_URL, username=USERNAME, password=PASSWORD, project_name=PROJECT_NAME) mock_post.return_value.status_code = 200 response = authentication.logout(conn) self.assertEqual(response.status_code, 200)
def test_logout(self, mock_post): """Validate logout method and that cookies are passed in request.""" conn = microstrategy.Connection(base_url=self.BASE_URL, username=self.USERNAME, password=self.PASSWORD, project_name=self.PROJECT_NAME) conn.cookies = self.COOKIES mock_post.return_value.status_code = 200 response = authentication.logout(conn) self.assertEqual(response.status_code, 200) self.assertEqual(mock_post.call_args[1]['cookies'], self.COOKIES)
def close(self): """Closes a connection with MicroStrategy REST API""" authentication.logout(connection=self)