def test_it_updates_session(sdk: mtds.Looker31SDK): """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"
def test_it_retrieves_session(sdk: mtds.Looker31SDK): """session() should return the current session.""" current_session = sdk.session() assert current_session.workspace_id == "production"