Skip to content

Commit

Permalink
test: fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
saw-jan committed Sep 17, 2024
1 parent 5ba6c10 commit 52b4e2e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/gui/shared/scripts/helpers/FilesHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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":
Expand Down

0 comments on commit 52b4e2e

Please sign in to comment.