Beispiel #1
0
    def renew(self):
        """Checks if the session is still alive. If so, renews the session and extends session expiration."""
        response = authentication.sessions(connection=self)

        if not response.ok:
            msg = "Session expired. Please reconnect to MicroStrategy."
            self.__response_handler(response=response, msg=msg)
        else:
            print("MicroStrategy connection was renewed.")
Beispiel #2
0
    def test_sessions(self, mock_put):

        conn = microstrategy.Connection(base_url=BASE_URL, username=USERNAME,
                                        password=PASSWORD, project_name=PROJECT_NAME)

        mock_put.return_value.status_code = 200

        response = authentication.sessions(conn)

        self.assertEqual(response.status_code, 200)
Beispiel #3
0
    def renew(self):
        """Checks if the session is still alive. If so, renews the session and extends session expiration."""
        _ = authentication.sessions(connection=self)

        print("MicroStrategy connection was renewed.")