예제 #1
0
def test_it_updates_session(sdk: mtds.LookerSDK):
    """update_session() should allow us to change the current workspace.
    """
    # Switch workspace to dev mode
    sdk.update_session(ml.WriteApiSession(workspace_id="dev"))
    current_session = sdk.session()

    assert isinstance(current_session, ml.ApiSession)
    assert current_session.workspace_id == "dev"

    # Switch workspace back to production
    current_session = sdk.update_session(
        ml.WriteApiSession(workspace_id="production"))

    assert isinstance(current_session, ml.ApiSession)
    assert current_session.workspace_id == "production"
예제 #2
0
def test_it_retrieves_session(sdk: mtds.LookerSDK):
    """session() should return the current session.
    """
    current_session = sdk.session()
    assert current_session.workspace_id == "production"
예제 #3
0
def test_it_retrieves_session(looker_client: mtds.LookerSDK):
    """session() should return the current session.
    """
    current_session = looker_client.session()
    assert current_session.workspace_id == "production"
    looker_client.logout()