aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/tests/support.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* python: Remove Python bindingsIngo Klöcker2025-02-031-156/+0
| | | | | | | | | | | | | | | | | * README: Update. * configure.ac: Remove checks, variables and file generations related to the Python bindings. Remove python from available_languages and default_languages. * lang/Makefile.am (DIST_SUBDIRS): Remove python. * lang/python: Remove. * m4/ax_pkg_swig.m4, m4/ax_python_devel.m4, m4/python.m4: Remove. -- The Python bindings have been moved to a separate Git repository: gpgmepy. GnuPG-bug-id: 7262
* python: Workaround for a regression in GnuPG 2.2.21Werner Koch2020-07-141-0/+6
| | | | | | | | | * lang/python/tests/support.py (is_gpg_version): New. * lang/python/tests/t-encrypt-sym.py: Add workaround. -- GnuPG-bug-id: 4991 Signed-off-by: Werner Koch <[email protected]>
* doc: use https:// for www.gnu.orgDaniel Kahn Gillmor2018-10-181-1/+1
| | | | | | -- Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* Python bindings tests: Near PEP8 complianceBen McGinnes2018-08-181-6/+23
| | | | * PEP8 compliance for the vast majoeity of the tests.
* python: Skip TOFU test if not supported by GnuPG.Justus Winter2017-04-111-0/+6
| | | | | | | | * lang/python/tests/support.py (have_tofu_support): New function. * lang/python/tests/t-quick-key-manipulation.py: Skip TOFU test if not supported by GnuPG. Signed-off-by: Justus Winter <[email protected]>
* python: Skip tests if running with GnuPG < 2.1.12.Justus Winter2017-03-271-1/+6
| | | | | | | | * lang/python/tests/support.py (assert_gpg_version): Fix error message. Skip all tests when we use GnuPG older than 2.1.12. GnuPG-bug-id: 3008 Signed-off-by: Justus Winter <[email protected]>
* python: Wrap 'gpgme_op_keylist_from_data_start'.Justus Winter2017-03-211-1/+7
| | | | | | | | | | | | | | * NEWS: Update. * lang/python/gpg/core.py (Context.keylist): New keyword argument 'source'. If given, list keys from 'source'. * lang/python/gpgme.i: Wrap the argument to 'gpgme_op_keylist_from_data_start'. * lang/python/tests/Makefile.am (py_tests): Add new test. * lang/python/tests/support.py (EphemeralContext): Do not throw an error if no agent has been started in the context. * lang/python/tests/t-keylist-from-data.py: New file. Signed-off-by: Justus Winter <[email protected]>
* python: Fix version check.Justus Winter2017-03-201-1/+3
| | | | | | | | * lang/python/tests/support.py (assert_gpg_version): Cope with non-released versions. Fixes-commit: e1cf8bab319ba1dea41ba5d711dbb66ffd8e6fd6 Signed-off-by: Justus Winter <[email protected]>
* python: Skip tests if GnuPG is too old.Justus Winter2017-03-201-0/+7
| | | | | | | | | | | | | | * lang/python/tests/support.py (assert_gpg_version): New function. * lang/python/tests/t-callbacks.py: Use the new function to skip the test if GnuPG is too old. * lang/python/tests/t-edit.py: Likewise. * lang/python/tests/t-encrypt-sym.py: Likewise. * lang/python/tests/t-quick-key-creation.py: Likewise. * lang/python/tests/t-quick-key-manipulation.py: Likewise. * lang/python/tests/t-quick-key-signing.py: Likewise. GnuPG-bug-id: 3008 Signed-off-by: Justus Winter <[email protected]>
* python: Remove superfluous initialization.Justus Winter2017-03-201-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lang/python/tests/support.py (init_gpgme): Remove. This is an remnant from the c tests. Nowadays, the Python bindings initialize GPGME automagically. * lang/python/tests/initial.py: Remove call to 'support.init_gpgme'. * lang/python/tests/t-callbacks.py: Likewise. * lang/python/tests/t-decrypt-verify.py: Likewise. * lang/python/tests/t-decrypt.py: Likewise. * lang/python/tests/t-edit.py: Likewise. * lang/python/tests/t-encrypt-large.py: Likewise. * lang/python/tests/t-encrypt-sign.py: Likewise. * lang/python/tests/t-encrypt-sym.py: Likewise. * lang/python/tests/t-encrypt.py: Likewise. * lang/python/tests/t-export.py: Likewise. * lang/python/tests/t-file-name.py: Likewise. * lang/python/tests/t-idiomatic.py: Likewise. * lang/python/tests/t-import.py: Likewise. * lang/python/tests/t-keylist.py: Likewise. * lang/python/tests/t-sig-notation.py: Likewise. * lang/python/tests/t-sign.py: Likewise. * lang/python/tests/t-signers.py: Likewise. * lang/python/tests/t-trustlist.py: Likewise. * lang/python/tests/t-verify.py: Likewise. * lang/python/tests/t-wait.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Make tests more robust.Justus Winter2017-03-141-11/+10
| | | | | | | | | * lang/python/tests/support.py (TemporaryDirectory): Always use our own version even if 'tempfile.TemporaryDirectory' is provided, because we need to use 'shutil.rmtree(..., ignore_errors=True)' to avoid it tripping over gpg-agent deleting its own sockets. Signed-off-by: Justus Winter <[email protected]>
* python: Fix teardown of ephemeral contexts.Justus Winter2017-02-171-1/+23
| | | | | | | | | | | | | | | | | | * lang/python/tests/support.py (EphemeralContext): New function. * lang/python/tests/t-quick-key-creation.py: Use the new function to manage ephemeral contexts. * lang/python/tests/t-quick-key-manipulation.py: Likewise. * lang/python/tests/t-quick-subkey-creation.py: Likewise. -- Previously, there was a problem with cleaning up ephemeral home directories. shutil.rmtree deleted the agents main socket, gpg-agent detected that, and deleted the other sockets as well, racing shutil.rmtree which did not cope will with that. Fix this by asking the agent nicely to shut down. Signed-off-by: Justus Winter <[email protected]>
* python: Support quick key creation.Justus Winter2017-02-161-0/+15
| | | | | | | | | | | | * NEWS: Update. * lang/python/gpg/constants/__init__.py: Import new file. * lang/python/gpg/constants/create.py: New file. * lang/python/gpg/core.py (Context.create_key): New function. * lang/python/tests/Makefile.am (XTESTS): Add new test. * lang/python/tests/support.py (TemporaryDirectory): New class. * lang/python/tests/t-quick-key-creation.py: New file. Signed-off-by: Justus Winter <[email protected]>
* python: Check "buffer" when writing to sys.stdout for python2 compat.Tobias Mueller2016-12-011-1/+5
| | | | | | | | | | | * lang/python/tests/support.py (print_data): Add check for buffer. -- When running with something like make -C lang/python check verbose=2 the test would fail under python2, because the file objects do not have a buffer property. Signed-off-by: Tobias Mueller <[email protected]>
* python: Import the topmost module in tests and examples.Justus Winter2016-10-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * examples/verifydetails.py: Only import the topmost module 'gpg' and update the code accordingly. * tests/support.py: Likewise. * tests/t-callbacks.py: Likewise. * tests/t-data.py: Likewise. * tests/t-decrypt-verify.py: Likewise. * tests/t-decrypt.py: Likewise. * tests/t-edit.py: Likewise. * tests/t-encrypt-large.py: Likewise. * tests/t-encrypt-sign.py: Likewise. * tests/t-encrypt-sym.py: Likewise. * tests/t-encrypt.py: Likewise. * tests/t-export.py: Likewise. * tests/t-file-name.py: Likewise. * tests/t-import.py: Likewise. * tests/t-keylist.py: Likewise. * tests/t-sig-notation.py: Likewise. * tests/t-sign.py: Likewise. * tests/t-signers.py: Likewise. * tests/t-trustlist.py: Likewise. * tests/t-verify.py: Likewise. * tests/t-wait.py: Likewise. * tests/t-wrapper.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Rename Python module from PyME to gpg.Daniel Kahn Gillmor2016-10-311-1/+1
| | | | | | | | This follows weeks of discussion on the gnupg-devel mailing list. Hopefully it will make it easier for people using Python to use GnuPG in the future. Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* python: Make 'get_key' more idiomatic.Justus Winter2016-10-131-0/+1
| | | | | | | | | | | | * lang/python/pyme/core.py (Context.get_key): Raise errors.KeyNotFound if the key is not found. This error is both a KeyError for idiomatic error handling as well as a GPGMEError so we don't break existing code. * lang/python/pyme/errors.py (KeyNotFound): New class. * lang/python/tests/support.py (no_such_key): New variable. * lang/python/tests/t-keylist.py: Test the new behavior. Signed-off-by: Justus Winter <[email protected]>
* python: Import from __future__ to align behavior of Python 2.7.Justus Winter2016-09-141-0/+3
| | | | | -- Signed-off-by: Justus Winter <[email protected]>
* python: Add an idiomatic interface.Justus Winter2016-07-151-2/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.ac: Bump required Python version. * lang/python/pyme/__init__.py: Update docstring. Import Context and Data. * lang/python/pyme/core.py (Context.encrypt): New function. (Context.decrypt): Likewise. (Context.sign): Likewise. (Context.verify): Likewise. * lang/python/pyme/errors.py: Add new errors. * lang/python/pyme/util.py (process_constants): Rework and return the inserted keys. * lang/python/tests/Makefile.am (EXTRA_DIST): Add new keys. * lang/python/tests/encrypt-only.asc: New file. * lang/python/tests/sign-only.asc: Likewise. * lang/python/tests/initial.py: Mark key 'Alpha' as trusted, import new keys. * lang/python/tests/support.py: Add fingerprints of known keys. (in_srcdir): New function. (print_data): Handle bytes too. (mark_key_trusted): New function. * lang/python/tests/t-decrypt-verify.py: Adjust test. Test idiomatic interface. * lang/python/tests/t-decrypt.py: Test idiomatic interface. * lang/python/tests/t-encrypt-sign.py: Likewise. * lang/python/tests/t-encrypt-sym.py: Likewise. * lang/python/tests/t-encrypt.py: Likewise. * lang/python/tests/t-idiomatic.py: Simplify. * lang/python/tests/t-keylist.py: Adjust to newly trusted key. * lang/python/tests/t-sign.py: Likewise. Test idiomatic interface. * lang/python/tests/t-signers.py: Likewise. * lang/python/tests/t-verify.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Initialize GPGME for the user.Justus Winter2016-06-061-1/+0
| | | | | | | * lang/python/pyme/core.py: Call 'check_version' and explain why. * lang/python/tests/support.py (init_gpgme): Drop call here. Signed-off-by: Justus Winter <[email protected]>
* python: Port more tests.Justus Winter2016-05-271-1/+2
| | | | | | | | | | | | | | * lang/python/pyme/core.py (Data._error_check): Add 'gpgme_data_get_file_name' to the list of functions not returning an error code. * lang/python/tests/Makefile.am (pytests): Add new tests. * lang/python/tests/support.py (verbose): New variable. * lang/python/tests/t-data.py: Test setting and getting the filename. * lang/python/tests/t-encrypt-large.py: New file. * lang/python/tests/t-file-name.py: Likewise. * lang/python/tests/t-trustlist.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Add more tests.Justus Winter2016-05-191-0/+6
| | | | | | | | | | | * lang/python/tests/Makefile.am (py_tests): Add new tests. * lang/python/tests/support.py (print_data): New function. * lang/python/tests/t-decrypt.py: Use new function. * lang/python/tests/t-encrypt.py: Likewise. * lang/python/tests/t-sign.py: New file. * lang/python/tests/t-encrypt-sym.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
* python: Port more tests.Justus Winter2016-05-171-0/+26
* lang/python/Makefile.am: Add bits from the c test suite. * lang/python/support.py: New file. * lang/python/t-decrypt.py: Likewise. * lang/python/t-encrypt.py: Likewise. Signed-off-by: Justus Winter <[email protected]>