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 )
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")
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
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)
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
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))
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')
def before_all(context): use_fixture(selenium_browser_chrome, context)
def step_impl(context): use_fixture(data_provider, context)
def step_impl(context): cmd = use_fixture(cmdline, context) cmd.run([])
def before_scenario(context, scenario): if device == "mobile": use_fixture(mobile, context) elif device == "web": use_fixture(web, context)
def before_feature(context, feature): # -- HINT: Recreate a new flaskr client before each feature is executed. use_fixture(flaskr_client, context)
def given_no_osrelease(context): behave.use_fixture(osrelease_fixture, context) context.scenario.osrelease.delete()
def before_feature(context, feature): use_fixture(selenium_browser_chrome, context)
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)
def before_all(context: runner.Context) -> None: context.base_url = behave.use_fixture(configuration.base_url, context)
def step_impl(context, argv): cmd = use_fixture(cmdline, context) cmd.run(shlex.split(argv))
def before_tag(context, tag): if tag == 'bing.ui': use_fixture( web_browser_fixture, context )
def before_scenario(context: runner.Context, scenario) -> None: context.driver = behave.use_fixture(configuration.driver, context)
def before_all(context): use_fixture(django_test_runner, context)
def before_tag(context, tag): if tag == "fixture.sqlite": use_fixture(sqlite_database, context) elif tag == "fixture.connections.file": use_fixture(connections_file, context)
def before_tag(context,tag): if tag =="fixture.browsertype.chrome": use_fixture(browser_firefox,context,timeout=20)
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)
def before_feature(context, feature): use_fixture(app_client, context)
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)
def after_feature(context, feature): try: use_fixture(close_browser, context) except InvalidSessionIdException: return None
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)
def before_all(context): use_fixture(browser_firefox, context)
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)
def before_tag(context, tag): if tag == 'fixture.spark.session': use_fixture(spark_session, context)
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)