Commit Graph

9 Commits

Author SHA1 Message Date
Ben McGinnes
5facba45c8 Python bindings tests: Near PEP8 compliance
* PEP8 compliance for the vast majoeity of the tests.
2018-08-18 20:29:14 +10:00
Justus Winter
159505a288
python: Fix skipping tests if running with GnuPG < 2.1.12.
* final.py: Import 'support.py' for the side-effect of checking the
GnuPG version.
* t-data.py: Likewise.
* t-protocol-assuan.py: Likewise.
* t-wrapper.py: Likewise.
* t-callbacks.py: Avoid warning about 'support' being unused.
* t-edit.py: Likewise.
* t-encrypt-sym.py: Likewise.
* t-file-name.py: Likewise.
* t-idiomatic.py: Likewise.
* t-sig-notation.py: Likewise.
* t-trustlist.py: Likewise.
* t-verify.py: Likewise.
* t-wait.py: Likewise.
* t-keylist-from-data.py: Trim unused imports.

GnuPG-bug-id: 3008
Fixes-commit: 348da58fe0
Signed-off-by: Justus Winter <justus@g10code.com>
2017-03-30 15:06:10 +02:00
Justus Winter
4572e8d2ac
python: Remove superfluous initialization.
* 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 <justus@g10code.com>
2017-03-20 16:07:07 +01:00
Justus Winter
4b32643450 python: Use vanity modules for constants in tests and examples.
* lang/python/gpg/constants/sig/notation.py: New file.
* lang/python/gpg/constants/sig/__init__.py: Import new module.

* lang/python/examples/assuan.py: Use more specific module for
constants, e.g. 'protocol.ASSUAN' instead of 'PROTOCOL_ASSUAN'.
* lang/python/examples/testCMSgetkey.py: Likewise.
* lang/python/tests/initial.py: Likewise.
* 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-protocol-assuan.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 <justus@g10code.com>
2016-10-31 15:42:35 +01:00
Justus Winter
20dc37a0e7 python: Import the topmost module in tests and examples.
* 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 <justus@g10code.com>
2016-10-31 15:42:35 +01:00
Daniel Kahn Gillmor
2fac017618 python: Rename Python module from PyME to gpg.
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 <dkg@fifthhorseman.net>
2016-10-31 15:42:27 +01:00
Justus Winter
dc23fdf555 python: Import from __future__ to align behavior of Python 2.7.
--
Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-14 12:15:57 +02:00
Justus Winter
3b37c4efcf python: Use more generic shebang.
--
Signed-off-by: Justus Winter <justus@g10code.com>
2016-09-14 12:15:57 +02:00
Justus Winter
3915842657 python: Port more tests.
* 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 <justus@gnupg.org>
2016-05-27 17:24:12 +02:00