From 8a987bd846a060cbc12c7ac11a17afafb91b162c Mon Sep 17 00:00:00 2001 From: Bruno Wagner Goncalves Date: Thu, 21 Aug 2014 12:54:10 -0300 Subject: Find the gpg binary on the system, even through symlinks --- src/leap/mail/smtp/tests/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/leap/mail/smtp/tests/__init__.py b/src/leap/mail/smtp/tests/__init__.py index 85419cb..5dc7465 100644 --- a/src/leap/mail/smtp/tests/__init__.py +++ b/src/leap/mail/smtp/tests/__init__.py @@ -21,6 +21,7 @@ Base classes and keys for SMTP gateway tests. """ import os +import distutils.spawn import shutil import tempfile from mock import Mock @@ -39,9 +40,14 @@ from leap.keymanager import ( from leap.common.testing.basetest import BaseLeapTest +def _find_gpg(): + gpg_path = distutils.spawn.find_executable('gpg') + return os.path.realpath(gpg_path) + + class TestCaseWithKeyManager(BaseLeapTest): - GPG_BINARY_PATH = '/usr/bin/gpg' + GPG_BINARY_PATH = _find_gpg() def setUp(self): # mimic BaseLeapTest.setUpClass behaviour, because this is deprecated -- cgit v1.2.3