Commit graph

12 commits

Author SHA1 Message Date
04d21c61fa
test: Add simple happypath annotation adding
Some checks failed
website / build (push) Has been cancelled
website / deploy (push) Has been cancelled
2025-11-29 21:11:32 +01:00
28c551e157
ref: Print optional error message on editor process error
Editor function takes an optional io object which is used to print an
error output if the subprocess errors.
2025-11-29 21:11:31 +01:00
762b4a288f
fix: Correct whitespace separation on editor shell call
Switch to using 'sequence'-delineated arguments given to the subprocess
run call to correctly handle whitespace.
Also check the output, so we exit if we have an error.
Test accordingly.
2025-11-29 21:11:31 +01:00
1ea149c1de
fix: Ensure quiet is a flag on the cli
We regressed quiet into requiring a value to be set as a cli option
(`--quiet=true`) instead of just functioning as a flag (`--quiet`). This
change restores the previous interface on the command line,
and adds a test to ensure no regressions.
2025-11-29 21:10:12 +01:00
e50fc9444a
test: Restructure test files
Extract the individual parsing tests (cli, env, rc) and add additional
configuration test file (TConf and config builder).

To extract the fixtures they have to go into an additional 'conftest.py'
file for pytest to recognize and automatically import them, see:
https://docs.pytest.org/en/stable/reference/fixtures.html#conftest-py-sharing-fixtures-across-multiple-files

and:
https://docs.pytest.org/en/stable/how-to/fixtures.html#using-fixtures-from-other-projects
2025-11-29 21:10:09 +01:00
ff0e6cccfb
fix: Correctly parse boolean config options set to false
Previously, when parsing config options that were set to 'false',
e.g. `TOPEN_NOTES_QUIET=false` in the env vars,
we would still be setting it to true.

This change fixes any falsy value to be correctly parsed as False.
2025-11-29 12:29:34 +01:00
46135f9325
test: Correctly fall back to EDITOR or VISUAL env vars 2025-11-28 23:08:18 +01:00
620a7bc401
test: Add TConf class tests 2025-11-28 23:08:18 +01:00
cb5e38b503
test: Add rc config file test 2025-11-28 23:08:17 +01:00
97478d62d1
test: Add tests for environment option setting 2025-11-28 23:08:17 +01:00
ee8fef930a
test: Fix correct cli option value casting
Since we can set the type of the relevant option in the OPTIONS dict, we
should also let the cli correctly cast them on parsing, just as the env
options do.
2025-11-28 23:08:16 +01:00
bd05dadf56
test: Add simple pytest harness 2025-11-28 23:08:16 +01:00