コード例 #1
0
    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")
コード例 #2
0
    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"
            )
コード例 #3
0
    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.'
            )
コード例 #4
0
    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)
コード例 #5
0
    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)
コード例 #6
0
 def close(self):
     """Closes a connection with MicroStrategy REST API"""
     authentication.logout(connection=self)