예제 #1
0
def before_tag( context, tag ):
    if tag == "fixture.server":
        use_fixture( options, context, timeout=10 )
        use_fixture( server, context, timeout=10 )
    if tag == "fixture.test-app":
        use_fixture( options, context, timeout=10 )
        use_fixture( testapp, context, timeout=10 )
예제 #2
0
def before_scenario(context, scenario):
    use_fixture(prcop_config_fixture, context)
    for tag in scenario.feature.tags:
        if tag == "fixture.requests_mock":
            use_fixture(request_mock_fixture, context)
        elif tag == "fixture.freezegun":
            use_fixture(freezegun_fixture, context)
        else:
            raise NotImplementedError(f"{tag} is not implemented")
예제 #3
0
def make_pool_manager(context, num, rg_type):
    behave.use_fixture(boto_patches, context)
    behave.use_fixture(mock_agents_by_ip_and_tasks, context)
    context.rg_type = rg_type
    context.rg_num = int(num)
    behave.use_fixture(mock_reload_resource_groups, context)
    context.pool_manager = PoolManager('mesos-test', 'bar', 'mesos')
    context.rg_ids = [i for i in context.pool_manager.resource_groups]
    context.pool_manager.max_capacity = 101
예제 #4
0
def before_all(context):
    """create custom_config"""
    try:
        host = os.environ['TEST_HOST']
    except:
        host = 'test'
    get_custom_config(context, host)

    # """create data set"""
    # generate_data(10, context)

    # """upload dataset to the server"""
    # upload_files_server(context)
    #
    # """upload dataset to msw"""
    # runner(context, "loader.py")
    #
    # """upload data to SERV&COMP table"""
    # update_gs()

    # """create file FEES to upload through riskbot"""
    # create_riskbot_fees()
    """create sessions of users"""
    use_fixture(session, context)

    # """make precondition steps to check ACCOUNTING"""
    # make_accounting_precondition(context)

    # """perform reconciliation"""
    # finish_reconciliation_process(context)

    perform_dr_calculation(context, '2020-08-18')
    """generate vars with data"""
    bills, entries = data_set_reconciliation()
    context.bills, context.entries, context.userdata = add_number_bills(
        context, bills, entries)
    context.modified_bills = copy.deepcopy(context.bills)
예제 #5
0
def make_pool_manager(context, num, rg_type):
    behave.use_fixture(boto_patches, context)
    behave.use_fixture(mock_agents_by_ip_and_tasks, context)
    context.rg_type = rg_type
    with mock.patch(
            'clusterman.aws.auto_scaling_resource_group.AutoScalingResourceGroup.load',
            return_value={},
    ) as mock_asg_load, mock.patch(
            'clusterman.aws.spot_fleet_resource_group.SpotFleetResourceGroup.load',
            return_value={},
    ) as mock_sfr_load, mock.patch(
            'clusterman.aws.ec2_fleet_resource_group.EC2FleetResourceGroup.load',
            return_value={},
    ) as mock_fleet_load:
        if context.rg_type == 'asg':
            mock_asg_load.return_value = mock_asgs(int(num), context.subnet_id)
        elif context.rg_type == 'sfr':
            mock_sfr_load.return_value = mock_sfrs(int(num), context.subnet_id)
        elif context.rg_type == 'fleet':
            mock_fleet_load.return_value = mock_fleets(int(num),
                                                       context.subnet_id)
        context.pool_manager = PoolManager('mesos-test', 'bar', 'mesos')
    context.rg_ids = [i for i in context.pool_manager.resource_groups]
    context.pool_manager.max_capacity = 101
예제 #6
0
def after_tag(context, tag):
    if tag == 'services.delete':
        try:
            use_fixture(delete_services, context)
        except Exception:
            logging.exception('Failed to delete service')
    elif tag == 'packages.delete':
        try:
            use_fixture(delete_packages, context)
        except Exception:
            logging.exception('Failed to delete package')
    elif tag == 'bot.create':
        try:
            use_fixture(delete_bots, context)
        except Exception:
            logging.exception('Failed to delete bots')
    elif tag == 'second_project.delete':
        try:
            use_fixture(delete_second_project, context)
        except Exception:
            logging.exception('Failed to delete second project')
    else:
        raise ValueError('unknown tag: {}'.format(tag))
예제 #7
0
def after_tag(context, tag):

    if tag == 'services.delete':
        try:
            use_fixture(delete_services, context)
        except Exception:
            logging.exception('Failed to delete service')

    if tag == 'packages.delete':
        try:
            use_fixture(delete_packages, context)
        except Exception:
            logging.exception('Failed to delete package')

    if tag == 'packages.delete_one':
        try:
            use_fixture(delete_one_package, context)
        except Exception:
            logging.exception('Failed to delete package')
예제 #8
0
def before_all(context):
    use_fixture(selenium_browser_chrome, context)
예제 #9
0
def step_impl(context):
    use_fixture(data_provider, context)
예제 #10
0
def step_impl(context):
    cmd = use_fixture(cmdline, context)
    cmd.run([])
예제 #11
0
def before_scenario(context, scenario):
    if device == "mobile":
        use_fixture(mobile, context)
    elif device == "web":
        use_fixture(web, context)
예제 #12
0
def before_feature(context, feature):
    # -- HINT: Recreate a new flaskr client before each feature is executed.
    use_fixture(flaskr_client, context)
예제 #13
0
def given_no_osrelease(context):
    behave.use_fixture(osrelease_fixture, context)
    context.scenario.osrelease.delete()
예제 #14
0
def before_feature(context, feature):
    use_fixture(selenium_browser_chrome, context)
예제 #15
0
def before_all(context: Context) -> None:
    use_fixture(init_firefox_driver, context)
def before_scenario(context, scenario):
    use_fixture(cluster_setup_and_tear_down, context)
예제 #17
0
def before_all(context: runner.Context) -> None:
    context.base_url = behave.use_fixture(configuration.base_url, context)
예제 #18
0
def step_impl(context, argv):
    cmd = use_fixture(cmdline, context)
    cmd.run(shlex.split(argv))
예제 #19
0
def before_tag(context, tag):
    if tag == 'bing.ui':
        use_fixture(
            web_browser_fixture, context
        )
예제 #20
0
def before_scenario(context: runner.Context, scenario) -> None:
    context.driver = behave.use_fixture(configuration.driver, context)
예제 #21
0
def before_all(context):
    use_fixture(django_test_runner, context)
예제 #22
0
def before_tag(context, tag):
    if tag == "fixture.sqlite":
        use_fixture(sqlite_database, context)
    elif tag == "fixture.connections.file":
        use_fixture(connections_file, context)
예제 #23
0
def before_tag(context,tag):
    if tag =="fixture.browsertype.chrome":
        use_fixture(browser_firefox,context,timeout=20)
예제 #24
0
def before_all(context):
    global BEHAVE_DEBUG_ON_ERROR
    BEHAVE_DEBUG_ON_ERROR = context.config.userdata.getbool('BEHAVE_DEBUG_ON_ERROR')
    behave.use_fixture(setup_configurations, context)
    behave.use_fixture(patch_meteorite, context)
예제 #25
0
def before_feature(context, feature):
    use_fixture(app_client, context)
예제 #26
0
def before_feature(context, feature):
    use_fixture(time_tracker_client, context)
def before_all(context):
    setup_debug_on_error(context.config.userdata)
    use_fixture(browser_firefox, context)
예제 #28
0
def after_feature(context, feature):
    try:
        use_fixture(close_browser, context)
    except InvalidSessionIdException:
        return None
예제 #29
0
def before_feature(context, feature):
    # -- HINT: Recreate a new flask client before each feature is executed.
    context.config.setup_logging()
    use_fixture(flaskr_client, context)
예제 #30
0
def before_all(context):
    use_fixture(browser_firefox, context)
예제 #31
0
def before_tag(context, tag):
    if tag == "fixture.sqlite":
        use_fixture(sqlite_database, context)
def before_tag(context, tag):
    if tag == 'fixture.httpd':
        use_fixture(httpd_context, context)
예제 #33
0
def before_tag(context, tag):
    if tag == 'fixture.spark.session':
        use_fixture(spark_session, context)
예제 #34
0
def step_impl(context):
    use_fixture(data_provider, context)
    content_list = context.content_list
    Helper.generate_content_list_from_db = MagicMock(return_value=content_list)
예제 #35
0
def before_tag(context, tag):
    if tag == 'fixture.httpd':
        use_fixture(httpd_context, context)