(path)
return {
        "functions": functions,
        "tests": tests
    }
prepare locust testcases

    Args:
        path (str): testcase file path.

    Returns:
        dict: locust tests data

            {
                "functions": {},
                "tests": []
            }
prepare locust testcases
prepare locust testcases
def prepare_locust_tests(path):
    """ prepare locust testcases

    Args:
        path (str): testcase file path.

    Returns:
        dict: locust tests data

            {
                "functions": {},
                "tests": []
            }

    """
    tests_mapping = loader.load_tests(path)
    parsed_tests_mapping = parser.parse_tests(tests_mapping)

    functions = parsed_tests_mapping.get("project_mapping", {}).get("functions", {})

    tests = []

    for testcase in parsed_tests_mapping["testcases"]:
        testcase_weight = testcase.get("config", {}).pop("weight", 1)
        for _ in range(testcase_weight):
            tests.append(testcase)

    return {
        "functions": functions,
        "tests": tests
    }
def prepare_locust_tests ( path ) : tests_mapping = loader . load_tests ( path ) parsed_tests_mapping = parser . parse_tests ( tests_mapping ) functions = parsed_tests_mapping . get ( "project_mapping" , { } ) . get ( "functions" , { } ) tests = [ ] for testcase in parsed_tests_mapping [ "testcases" ] : testcase_weight = testcase . get ( "config" , { } ) . pop ( "weight" , 1 ) for _ in range ( testcase_weight ) : tests . append ( testcase ) return { "functions" : functions , "tests" : tests }