The second and third section of the pytest tests were rewritten
to be more portable for either Linux Debian 13, or Windows 10.
As confirmed during this revision, the outcome of the optional
--smart-prepend mode still depends on the format of the leading
time stamp.
Second, special characters presumed to provide a file name without
a white space (for instance the underscore), though working well in
Linux Debian, are not reliably processed in Windows. To facilitate
a subsequent refactoring of appendfilename, the corresponding tests
already are present, however currently muted.
Thirdly, the reinstallment of pytest.ini and labels allows again
to address the pytest tests by the name of their set: default,
prepend, and smart.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
With pytest labels installed (default, prepend, smart) it will be
easier to recognize which sub set contains a failing test.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
Previously present labels to check appendfilename's work in either
default, prepend, or smart prepend pattern as well as file
pytest.ini are reinstalled again.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
The third section of tests about smartly prepending a string -- i.e.
to insert a string right after the time or date stamp -- was edited.
Manual tests in Linux Debian and Windows 10 as well as with pytest
on either operating system confirm inconsistencies of the format
of the file name eventually generated.[1,2]
In addition, the implementation differs in robustness to deploy
special characters like for instance the underscore as a separator
to enclose the string to add. Instead of `_` (as in Debian), Windows
tends to enclose these separators with single quotes (`'_'`) instead.
The default by `appendfilename` to use a single blank character
still is considered "safe to be used" _for `appendfilename`_ though
e.g. the underscore would represent a safe alternative if file names
with white space are not acceptable.
[1] https://github.com/novoid/appendfilename/issues/15
[2] https://github.com/novoid/appendfilename/issues/16
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
Documentation about the second set of tests (prepend a string to
the original file name of a file) was updated.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
In similar pattern to the first section (append a string), the
tests of the second section (to prepend a string to the orginal
file name) are revised for better portability on different
operating systems.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
Documentation about the first set of tests (default append of a string
to the file's file name) was updated.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
The checks about appendfilename's default, i.e. to insert a string
just prior to the file extension were edited. This aims to provide
better portability of the tests when launching pytest either in
Linux Debian 13/trixie, or Windows 10.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
The scope of the automated pytest checks is extended to equally
consider Windows 2022 and MacOS 14. At present, these are the
most recent OS images of Windows, or MacOS, respectively.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
This commit aims to provide an automated testing with pytest moderated
by GitHub actions. Its scope is constrained twice -- both for pytest,
as well as for the testing operating system -- to familiarize
1) how to file a PR to project I don't own which however now allows
me to admit a PR.
2) To learn if in this situation a contributor can set GitHub actions
in a repository owned by an other user.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
The export by tangle from the org file is constrained to the first
set of tests by pytest. This section is rewritten to yield a more
portable format to work either for Linux Debian, or Windows 10.
Running
```shell
python -m pytest
```
in their respective virtual environments, the set of 60 items to
test all pass (Debian: Python 3.12.6, pytest 8.3.3; Windows 10:
Python 3.12.4, pytest 8.3.3).
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
By now, an update/move to `pyreadline3` is sensible (as already in
the principal branch). Extension with `pytest` offers an optional
test on site.
In Linux Debian 13/trixie (virtual environment of Python 3.12.4 and
pytest 8.3.3), out of 540 tests all 540 pass, and 4 are tagged
with a warning. Pylint (3.3.1)/astroid (3.3.5) indicate a couple of
possible improvements (r strings, etc.) and hence rate
test_appendfilename.py with 6.21/10 -- but does not report a syntax
error.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
Module `pyreadline3`, a fork of `pyreadline` no longer actively
maintained on PyPI replaces its predecessor. This equally aims
to account for an reported problem using the utility in Windows.[1]
[1] https://github.com/novoid/appendfilename/issues/18
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
Ahead of the addition of checks about three stamp pattern issued
by date2name, the checker about appendfilename's the option
--smart-prepent is reorganized to be more compact/easier to be
read. For now, this outweights each filename being checked twice.
This extends the pattern tested to consider all five stamp formats
issued by date2name when passing appendfilename either in default,
or prepend mode. It doesn't yet the --smart-prepend mode as third
option.
Checks of appendfilename --smart-prepend now consider date2name'
default time stamp (YYYY-MM-DD), the by date2name --withtime
(YYYY-MM-DDTHH.MM.SS), or absence of such by pattern recognition
with regular expressions.
For programmatic testing of appendfilename, a test generator
is written. This tangles a Makefile, a pytest.ini and the
test script. Despite the incomplete coverage of this approach,
an inconsistency in appendfilename's interaction on files with
the simple YYYY-MM-DD timestamp (date2name) is spot.