Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/test_CLI.py: create $GNUPGHOME on the fly (#31)
* tests/test_CLI.py: create $GNUPGHOME on the fly - avoid expiration of keys by re-creating them - prevent gnupg version being incompatible with $GNUPGHOME in git Storing binary data is bad because: - git is not good at handling binary data - binary data is harder to inspect (remember the xz incident) * TransRead.read: pass on -1 instead of 0xFFFFFFFFFFFFFFFF Passing 0xFFFFFFFFFFFFFFFF to read causes python to complain about: OverflowError: cannot fit 'int' into an index-sized integer Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de> * tests: Rework CLI tests The current tests do not take into account whether the `gpg` package has been installed or not. If it is missing, the tests should be skipped. Furthermore, the output of the tests must be checked in order to decide whether tests fail due to an exception or whether the desired error message is displayed. Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de> * CLI: rework PGP verification The verification of PGP signatures had some flaws and didn't work, because the Python API and the GPG interface have changed. Inline signatures were not detected, because of a comparison of string and byte array. And even after this the code failed, because `sig.status` is no longer available. Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de> * tests/test_CLI.py: factor out verification logic into its own function * add gpg verification methods using gpg and gpgv binaries * ci: Fix GPG tests Fixes up the way that the GPG tests work by adding a new "native" python test version. This is required because the python 'gpg' module *must* come from the host package in order to patch libgpgme (e.g. 'python3-gpg'). It's not possible to get this module installed with the pre-canned python versions provided by GitHub Actions, so the gpg tests are skipped for this version, but using the host native python can. --------- Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de> Co-authored-by: Jörg Sommer <joerg.sommer@navimatix.de> Co-authored-by: Joshua Watt <JPEWhacker@gmail.com>
- Loading branch information