Regexes' grouping with parentheses and the definition of the
standard pattern just ahead of the month pattern allowed to spot
a plausible cause for the problem to retract all autogenerated
stamps. In the present scope of pytest, the additional lookafter
now sufficies to enable the retraction of all five stamp pattern.
The regexes are easier to read if their elements are grouped in
parentheses. Some already were organized this way, so this commit
only extends the pattern to cover all of them. Pytest does not
identify a functional change.
Again, testing fails for the two variants -r/--remove when aiming
to retract a -w/--withtime stamp. This commit eventually offers
the same coverage of tests now on folders (all five fixed stamp
pattern to add and their retraction).
Because the pattern for testing on files will be used for the on
folders, a reorganization of the instructions. Stamps checked so
far are generated either in default pattern, or (compact, month,
short) pattern, or with time. Thus, it appears reasonable to
harmonize this sequence across the relevant files.
Many of pytest's test functions iterate over levels. For local
testing of date2name's action, e.g. about --remove, it may be
useful to narrow testing further than only "files" (and later, to
"folders"). Thus, a second layer of keyword markers was introduced
which may be used in two forms:
+ in combination with either one of (files, folders) for a check
which would check e.g., the remove of stamps on files; or
+ independent og (files, folders) to check e.g., the remove of
stamps on files and on folders
The introduction of a pytest.ini appears as a convienient approach
to group tests of pytests sharing an element in common. This seems
beneficial as long as there is no reliable approch identified to
stack "file" and "folder" as levels of an additional parameter in
theses tests for date2name.
By now, the two layers "elementary" and "files" are installed.
The present test functions act on files only. Early tests to stack
folders on top of the present functions do not work reliably yet.
Thus, better to name the functions (uniformly) about what they test
which are actions on files only. This change equally prevents some
line breaks on the CLI, too.
Down the road, the application's action on folders will be checked
as well. Thus, it is appropriate to alter the functions' names to
querry the time of creation/modifications into a more flexible, yet
correct form.
The retraction of the -x parameter for pytest ensures that all
test functions defined are actually used. Previously, testing
stopped immediately, conveying an incomplete picture of date2name's
work implemented. Testing the retraction option -r, there is no
need for a delay between the indivdual options, either.
The development version on GitHub offers the option to retract
time stamps date2name prepended to the files' file names. As this
version of the test script reveals, stamps obtained with the option
--withtime however are not fully reverted. The finding was shared
with Karl Voit as an issue for date2name earlier today (2021-09-22)
for a cross check.
An Emacs .org file is the source in to (re)create a Python script
to perform a few tests on date2name's functions to prepend a date/
time stamp. The .org file equally is source for the Makefile to
automate the testing even further.
Set up for and tested in Linux Debian 12/bookworm (branch testing)
with Python 3.9.2, pytest 6.2.4 (for Python 3); GNU Make 4.3;
GNU Emacs 27.1 backed by elpa org 9.4.0.