def then_i_obtain_the_server_list(step): assert_true(world.req.ok, HTTP_CODE_NOT_OK.format(world.req.status_code, world.req.content)) response = Utils.assert_json_format(world.req) for results in world.servers_body: assert_in(results, response[SERVERS]) Utils.delete_all_rules_from_tenant()
def then_i_obtain_all_the_rules_of_the_server(step): response = Utils.assert_json_format(world.req) assert_equals(response[SERVER_ID], world.server_id) assert_equals(response[TENANT_KEY], world.tenant_id) assert_equals(len(response[RULES]), world.number_rules) for rule, u_response in zip(world.rules, response[RULES]): assert_in(rule['name'], u_response['name']) world.rules = [] Utils.delete_all_rules_from_tenant()
def before_scenario(context, scenario): # Set default headers with correct token before every scenario context.headers = HEADERS Utils.delete_all_rules_from_tenant() context.rules = []
def setup_scenario(scenario): world.headers = HEADERS Utils.delete_all_rules_from_tenant() world.rules = []