From 0c382420d377ec5532a0007b5aaf8846f81de506 Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 26 Jan 2021 22:03:44 +0100 Subject: [PATCH] fix i18n test after format --- tests/test_i18n_keys.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_i18n_keys.py b/tests/test_i18n_keys.py index b41e8cd78..f7455bc8e 100644 --- a/tests/test_i18n_keys.py +++ b/tests/test_i18n_keys.py @@ -24,9 +24,9 @@ def find_expected_string_keys(): # m18n.n( "foo" # YunohostError("foo" # # i18n: foo - p1 = re.compile(r'm18n\.n\(\s*[\"\'](\w+)[\"\']') - p2 = re.compile(r'YunohostError\([\'\"](\w+)[\'\"]') - p3 = re.compile(r'# i18n: [\'\"]?(\w+)[\'\"]?') + p1 = re.compile(r"m18n\.n\(\n*\s*[\"\'](\w+)[\"\']") + p2 = re.compile(r"YunohostError\(\n*\s*[\'\"](\w+)[\'\"]") + p3 = re.compile(r"# i18n: [\'\"]?(\w+)[\'\"]?") python_files = glob.glob("src/yunohost/*.py") python_files.extend(glob.glob("src/yunohost/utils/*.py")) @@ -78,7 +78,7 @@ def find_expected_string_keys(): for funcname in subprocess.check_output(cmd, shell=True).decode("utf-8").strip().split("\n"): yield "log_" + funcname - p4 = re.compile(r"OperationLogger\([\"\'](\w+)[\"\']") + p4 = re.compile(r"OperationLogger\(\n*\s*[\"\'](\w+)[\"\']") for python_file in python_files: content = open(python_file).read() for m in ("log_" + match for match in p4.findall(content)): @@ -86,7 +86,7 @@ def find_expected_string_keys(): # Global settings descriptions # Will be on a line like : ("service.ssh.allow_deprecated_dsa_hostkey", {"type": "bool", ... - p5 = re.compile(r" \([\"\'](\w[\w\.]+)[\"\'],") + p5 = re.compile(r" \(\n*\s*[\"\'](\w[\w\.]+)[\"\'],") content = open("src/yunohost/settings.py").read() for m in ("global_settings_setting_" + s.replace(".", "_") for s in p5.findall(content)): yield m