예제 #1
0
def before_scenario(context: Context, scenario):
    for database in context.client.databases().all():
        database.delete()
    context.sessions = []
    context.sessions_to_transactions = {}
    context.sessions_parallel = []
    context.sessions_to_transactions_parallel = {}
    context.sessions_parallel_to_transactions_parallel = {}
    context.tx = lambda: context.sessions_to_transactions[context.sessions[0]][0]
    context.things = {}
    context.get = lambda var: context.things[var]
    context.put = lambda var, thing: _put_impl(context, var, thing)
    context.get_thing_type = lambda root_label, type_label: _get_thing_type_impl(context, root_label, type_label)
    context.clear_answers = lambda: _clear_answers_impl(context)
예제 #2
0
def before_scenario(context: Context, scenario):
    for tag in IGNORE_TAGS:
        if tag in scenario.effective_tags:
            scenario.skip("tagged with @" + tag)
            return

    for database in context.client.databases().all():
        context.client.databases().delete(database)
    context.sessions = []
    context.sessions_to_transactions = {}
    context.sessions_parallel = []
    context.sessions_to_transactions_parallel = {}
    context.sessions_parallel_to_transactions_parallel = {}
    context.tx = lambda: context.sessions_to_transactions[context.sessions[0]][0]
    context.things = {}
    context.get = lambda var: context.things[var]
    context.put = lambda var, thing: _put_impl(context, var, thing)
    context.get_thing_type = lambda root_label, type_label: _get_thing_type_impl(context, root_label, type_label)
    context.clear_answers = lambda: _clear_answers_impl(context)
예제 #3
0
def before_scenario(context: Context, scenario):
    for database in context.client.databases().all():
        database.delete()
    context.sessions = []
    context.sessions_to_transactions = {}
    context.sessions_parallel = []
    context.sessions_to_transactions_parallel = {}
    context.sessions_parallel_to_transactions_parallel = {}
    context.tx = lambda: context.sessions_to_transactions[context.sessions[0]][
        0]
    context.things = {}
    context.get = lambda var: context.things[var]
    context.put = lambda var, thing: _put_impl(context, var, thing)
    context.get_thing_type = lambda root_label, type_label: _get_thing_type_impl(
        context, root_label, type_label)
    context.clear_answers = lambda: _clear_answers_impl(context)
    context.option_setters = {
        "session-idle-timeout-millis":
        lambda option, value: option.set_session_idle_timeout_millis(int(value)
                                                                     ),
        "transaction-timeout-millis":
        lambda option, value: option.set_transaction_timeout_millis(int(value)
                                                                    ),
    }
예제 #4
0
def step_impl(context: Context):
    for session in context.sessions:
        session.close()
    context.sessions = []