aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/tests/support.py
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-05-18 13:33:36 +0000
committerJustus Winter <[email protected]>2016-05-19 09:09:45 +0000
commit464d404c8816fc93baf945816c93e86bdeb0ea39 (patch)
treeebf28609039cc527c758453eae125cfc39104788 /lang/python/tests/support.py
parentpython: More type conversion fixes. (diff)
downloadgpgme-464d404c8816fc93baf945816c93e86bdeb0ea39.tar.gz
gpgme-464d404c8816fc93baf945816c93e86bdeb0ea39.zip
python: Add more tests.
* 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]>
Diffstat (limited to 'lang/python/tests/support.py')
-rw-r--r--lang/python/tests/support.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lang/python/tests/support.py b/lang/python/tests/support.py
index 36b3c888..a57d5816 100644
--- a/lang/python/tests/support.py
+++ b/lang/python/tests/support.py
@@ -15,6 +15,7 @@
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, see <http://www.gnu.org/licenses/>.
+import sys
import os
from pyme import core
@@ -24,3 +25,8 @@ def make_filename(name):
def init_gpgme(proto):
core.check_version()
core.engine_check_version(proto)
+
+def print_data(data):
+ if int(os.environ.get('verbose', 0)) > 1:
+ data.seek(0, os.SEEK_SET)
+ sys.stdout.buffer.write(data.read())