summaryrefslogtreecommitdiff
path: root/tests/utilities.py
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2016-11-30 02:30:44 -0500
committerDylan Baker <dylan@pnwbakers.com>2017-08-14 09:30:34 -0700
commitb0e2f322aa571a5e1999c069779f589e282a566c (patch)
treed5b905ff596a045ef4c8e5c9540772218b026230 /tests/utilities.py
parentc377ee5bd6e2b64be8bbdd5df72ac3ca50373134 (diff)
convert from pygpgme to the python "gpg" module
This converts from the now abandoned pygpgme project for wrapping gpgme, to the upstream gpgme python bindings (which are descended from the pyme project, before they became official). Largely this change should not be user visible, but there are a couple cases where the new bindings provide slightly more detailed error messages, and alot directly presents those messages to users. This patch has been significantly revised and updated by Dylan Baker, but was originally authored by Daniel Kahn Gillmor. Fixes #1069
Diffstat (limited to 'tests/utilities.py')
-rw-r--r--tests/utilities.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/utilities.py b/tests/utilities.py
index 45433c99..402feb38 100644
--- a/tests/utilities.py
+++ b/tests/utilities.py
@@ -21,7 +21,7 @@ from __future__ import absolute_import
import functools
import unittest
-import gpgme
+import gpg
import mock
@@ -149,7 +149,7 @@ class ModuleCleanup(object):
def make_uid(email, uid=u'mocked', revoked=False, invalid=False,
- validity=gpgme.VALIDITY_FULL):
+ validity=gpg.constants.validity.FULL):
uid_ = mock.Mock()
uid_.email = email
uid_.uid = uid
@@ -162,7 +162,7 @@ def make_uid(email, uid=u'mocked', revoked=False, invalid=False,
def make_key(revoked=False, expired=False, invalid=False, can_encrypt=True,
can_sign=True):
- mock_key = mock.create_autospec(gpgme.Key)
+ mock_key = mock.Mock()
mock_key.uids = [make_uid(u'foo@example.com')]
mock_key.revoked = revoked
mock_key.expired = expired