diff --git a/test/test_common.py b/test/test_common.py index bb42d14..a0da6b3 100644 --- a/test/test_common.py +++ b/test/test_common.py @@ -62,7 +62,7 @@ def test_config_dict_04(self): conf_filename = './test/test_conf.ini' # 读取配置文件, 中文编码 - ds = conf_as_dict(conf_filename, encode='utf-8') + ds = conf_as_dict(conf_filename, encoding='utf-8') d = ds[1] list1 = ['show_opt', 'show_opt_common', 'show_opt_common2', 'get_args', 'show_rule_pattern', diff --git a/test/test_csv.py b/test/test_csv.py index 63e2b85..9e62d3e 100644 --- a/test/test_csv.py +++ b/test/test_csv.py @@ -39,7 +39,7 @@ def test_csv_02(self): with io.open(csv_file_name, 'w', encoding='utf8') as f: f.write(csv_content) f.close() - result = csv_file_to_list(csv_file_name, encode='utf-8') + result = csv_file_to_list(csv_file_name, encoding='utf-8') shutil.rmtree(os.path.dirname(csv_file_name)) assert len(result) == 2 assert len(result[0]) == 2 @@ -54,7 +54,7 @@ def test_csv_03(self): with io.open(csv_file_name, 'w', encoding='gbk') as f: f.write(csv_content) f.close() - result = csv_file_to_list(csv_file_name, encode='gbk') + result = csv_file_to_list(csv_file_name, encoding='gbk') shutil.rmtree(os.path.dirname(csv_file_name)) assert len(result) == 2 assert len(result[0]) == 2