For an easier launch of the unit tests by `pytest`, file
`unit_tests.py` was renamed and thus now is discovered automatically
from the root of the project.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
Previously, tests about the deletion of tagtrees in GitHub's Windows
osrunner failed, while the same tests in the runners of Ubuntu an
MacOS passed. This likely is due how these files are "released" for
deletion with greter ease (Linux/MacOS), or not (Windows). This is
addressed by function `force_rmtree` added to `__init__.py`, result
of a discussion with Claude AI/Sonnet 4.6. Simultaneously, this
commit corrects the addition of the file extension `.lnk` in one of
the tests.
When submitted to the check by `ci_pytest.yml`, now each unit test
compiled in `unit_tests.py` passes with Python 3.14 and either
osrunner of Ubuntu 24.04.3, Microsoft Windows Server 2025 /
10.0.26100, and macOS 15.7.4 GitHub currently provides as
ubuntu-latest, windows-latest, macos-latest.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
Apparently, the organization of linkfiles in Windows differs from the
one in Linux; and much more, than thought earlier. In addition to
this, the additional `.lnk` is visible only in a shell (git BASH;
Windows' `cmd.exe`, or PowerShell) however not in the default GUI
filemanager Windows is shipped (regardless if the user opts-in to
display file extensions like `.txt`, or not).
The edit of this commit thus only is a starter of additional checks
and likely similar edits to the source code.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
Tkinter is required only for the new --gui option but not for filetags
core functionality, still it has to be installed in order to run
filetags at the moment.
This commit makes the import of Tkinter optional as long as the --gui
option is not passed, thus allowing users that don't have Tkinter
installed on their system to keep using filetags like before.
In case the --gui option is passed and Tkinter can't be imported an
error message is printed instructing the user to install the Python
Tkinter module similar to the safe import of other modules.
For greater portability of the defined unit tests, the test on
filetags.extract_from_path was rekeyed to use a definition based
on os.path.join().
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
For greater portability of the test (i.e., to Windows), checks in
def test_extract_tags_from_path are rekeyed.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
For a better overview / count of failed tests over all tests,
pytest now is requested to run twice: once the short line of
dots, F, E, etc; and once at verbosity level one.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
When running the unit tests with GitHub's Windows runner image,
one test currently fails for lack of (sufficient) support for
unicode characters. To address this issue, the file context
managers are amended by an explicit `encoding="utf-8"`.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
For greater flexibility, the ci allows `master` as an additional
name of the local default branch beside frequently seen `main`.
It however replaces `main` by `master` as the default in the
blessed repository.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
Unit tests already provided shall equally be used across GitHub's
runner images of Ubuntu, Windows, and MacOS to check edits/pull
requests.
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>
To ease testing prior to the merge into the default branch, the
scope is extended to a (temporary) dev branch (if used).
Signed-off-by: Norwid Behrnd <nbehrnd@yahoo.com>