(csv_file: Text)
return csv_content_list
load csv file and check file content format

    Args:
        csv_file (str): csv file path, csv file content is like below:

    Returns:
        list: list of parameters, each parameter is in dict format

    Examples:
        >>> cat csv_file
        username,password
        test1,111111
        test2,222222
        test3,333333

        >>> load_csv_file(csv_file)
        [
            {'username': 'test1', 'password': '111111'},
            {'username': 'test2', 'password': '222222'},
            {'username': 'test3', 'password': '333333'}
        ]
load csv file and check file content format
load csv file and check file content format
def load_csv_file(csv_file: Text) -> List[Dict]:
    """ load csv file and check file content format

    Args:
        csv_file (str): csv file path, csv file content is like below:

    Returns:
        list: list of parameters, each parameter is in dict format

    Examples:
        >>> cat csv_file
        username,password
        test1,111111
        test2,222222
        test3,333333

        >>> load_csv_file(csv_file)
        [
            {'username': 'test1', 'password': '111111'},
            {'username': 'test2', 'password': '222222'},
            {'username': 'test3', 'password': '333333'}
        ]

    """
    if not os.path.isabs(csv_file):
        global project_meta
        if project_meta is None:
            raise exceptions.MyBaseFailure("load_project_meta() has not been called!")

        # make compatible with Windows/Linux
        csv_file = os.path.join(project_meta.RootDir, *csv_file.split("/"))

    if not os.path.isfile(csv_file):
        # file path not exist
        raise exceptions.CSVNotFound(csv_file)

    csv_content_list = []

    with open(csv_file, encoding="utf-8") as csvfile:
        reader = csv.DictReader(csvfile)
        for row in reader:
            csv_content_list.append(row)

    return csv_content_list
def load_csv_file ( csv_file : Text ) -> List [ Dict ] : if not os . path . isabs ( csv_file ) : global project_meta if project_meta is None : raise exceptions . MyBaseFailure ( "load_project_meta() has not been called!" ) # make compatible with Windows/Linux csv_file = os . path . join ( project_meta . RootDir , * csv_file . split ( "/" ) ) if not os . path . isfile ( csv_file ) : # file path not exist raise exceptions . CSVNotFound ( csv_file ) csv_content_list = [ ] with open ( csv_file , encoding = "utf-8" ) as csvfile : reader = csv . DictReader ( csvfile ) for row in reader : csv_content_list . append ( row ) return csv_content_list