test: correct pytest regex, test_smart_prepend

The regex condition did not match the pattern previously established
by Karl Voit -- erroneously, it would fail on the 30th and 31st of
each relevant month expressed with the short date stamp (YYMMDD) of
date2name.

Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
This commit is contained in:
Norwid Behrnd 2024-11-12 18:06:24 +01:00
parent 82bfd8e66e
commit f79abfe062
2 changed files with 2 additions and 2 deletions

View file

@ -283,7 +283,7 @@ def test_smart_prepend(arg1, arg2, arg3):
old_filename_no_timestamp = old_filename[8:]
# pattern `--short` # currently fails
elif re.search(r"^\d{4}[012]\d[012]\d", old_filename):
elif re.search(r"^\d{4}[012]\d[0-3]\d", old_filename):
time_stamp = old_filename[:6]
time_stamp_separator = old_filename[6]
old_filename_no_timestamp = old_filename[7:]

View file

@ -467,7 +467,7 @@ def test_smart_prepend(arg1, arg2, arg3):
old_filename_no_timestamp = old_filename[8:]
# pattern `--short` # currently fails
elif re.search(r"^\d{4}[012]\d[012]\d", old_filename):
elif re.search(r"^\d{4}[012]\d[0-3]\d", old_filename):
time_stamp = old_filename[:6]
time_stamp_separator = old_filename[6]
old_filename_no_timestamp = old_filename[7:]