From 52b4e2e6045d6c9832e8af0a1f74980c05efe99e Mon Sep 17 00:00:00 2001 From: Saw-jan Date: Tue, 17 Sep 2024 10:47:41 +0545 Subject: [PATCH] test: fix code --- test/gui/shared/scripts/helpers/FilesHelper.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/gui/shared/scripts/helpers/FilesHelper.py b/test/gui/shared/scripts/helpers/FilesHelper.py index 3bff3642cbd..430fb3a65a0 100644 --- a/test/gui/shared/scripts/helpers/FilesHelper.py +++ b/test/gui/shared/scripts/helpers/FilesHelper.py @@ -11,10 +11,13 @@ def buildConflictedRegex(filename): # TODO: improve this for complex filenames namepart = filename.split(".")[0] extpart = filename.split(".")[1] - return ( - f"{namepart} \\(conflicted copy \\d{4}-\\d{2}-\\d{2} \\d{6}\\)\\.{extpart}" + # pylint: disable=anomalous-backslash-in-string + return "%s \(conflicted copy \d{4}-\d{2}-\d{2} \d{6}\)\.%s" % ( + namepart, + extpart, ) - return f"{filename} \\(conflicted copy \\d{4}-\\d{2}-\\d{2} \\d{6}\\)" + # pylint: disable=anomalous-backslash-in-string + return "%s \(conflicted copy \d{4}-\d{2}-\d{2} \d{6}\)" % filename def sanitizePath(path): @@ -77,7 +80,7 @@ def get_size_in_bytes(size): size_num = int(match.group(1)) size_unit = match.group(2) - if not (size_unit := match.lower()): + if not (size_unit := size_unit.lower()): return size_num if size_unit in units: if size_unit == "b":