def __init__(self, st=None, **kwargs): if not kwargs.has_key('cookie_key') and st is None: kwargs['cookie_key'] = DEFAULT_COOKIE_KEY if st is None: self.app = AppWithMultipleClients(make_application(**kwargs)) assert self.app.get('/delete_all').status[:3] == '200' self.app_args = kwargs else: self.app = st.app # share the same webapp, but we'll use our own cookies self.app_args = st.app_args assert len( kwargs ) == 0, "no args should be passed other than st if st is given" self.ss = self.new_session_state() self.rpcs = None # calls on Session object waiting to be made remotely self.outputs = None # outputs of local procedure calls self.api_statuses = None # whether various APIs are up or down # extra checks; if None, then don't do them self.check_expir = None self.check_sid_is_not = None # if the session gets big and goes to db but then shrinks and # goes back to cookie-only, it is ok if it still in the db after # that, though our mock will say it shouldn't be. If this is # true, self.ss.in_mc/db will be set to True if the remote ss # has in_mc/in_db as True. self.ok_if_in_mc_remotely = False self.ok_if_in_db_remotely = False self.data_should_be_in_cookie = False
def __init__(self, st=None, **kwargs): if not kwargs.has_key('cookie_key') and st is None: kwargs['cookie_key'] = DEFAULT_COOKIE_KEY if st is None: self.app = AppWithMultipleClients(make_application(**kwargs)) assert self.app.get('/delete_all').status[:3] == '200' self.app_args = kwargs else: self.app = st.app # share the same webapp, but we'll use our own cookies self.app_args = st.app_args assert len(kwargs)==0, "no args should be passed other than st if st is given" self.ss = self.new_session_state() self.rpcs = None # calls on Session object waiting to be made remotely self.outputs = None # outputs of local procedure calls self.api_statuses = None # whether various APIs are up or down # extra checks; if None, then don't do them self.check_expir = None self.check_sid_is_not = None # if the session gets big and goes to db but then shrinks and # goes back to cookie-only, it is ok if it still in the db after # that, though our mock will say it shouldn't be. If this is # true, self.ss.in_mc/db will be set to True if the remote ss # has in_mc/in_db as True. self.ok_if_in_mc_remotely = False self.ok_if_in_db_remotely = False self.data_should_be_in_cookie = False
from main import make_application application = make_application()