summaryrefslogtreecommitdiff
path: root/src/leap/mail
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2014-08-21 13:58:15 -0500
committerKali Kaneko <kali@leap.se>2014-08-21 13:58:15 -0500
commit804a0b388a8d0fc4e03ec2c525f277d5eabaae7f (patch)
treeaded7741daed22b3975abe40b662cf3be1115493 /src/leap/mail
parent910b86b3f7fecc760d5da02ef89ac1d6fd62299c (diff)
parent53861af18ecf36dfebb9ae56c5b412dd1be0dd78 (diff)
Merge remote-tracking branch 'bwagner-github/fix_tests_on_mac' into develop
Diffstat (limited to 'src/leap/mail')
-rw-r--r--src/leap/mail/imap/tests/test_imap.py2
-rw-r--r--src/leap/mail/smtp/tests/__init__.py10
2 files changed, 9 insertions, 3 deletions
diff --git a/src/leap/mail/imap/tests/test_imap.py b/src/leap/mail/imap/tests/test_imap.py
index fd88440..e87eb7b 100644
--- a/src/leap/mail/imap/tests/test_imap.py
+++ b/src/leap/mail/imap/tests/test_imap.py
@@ -238,7 +238,7 @@ class IMAP4HelperMixin(BaseLeapTest):
os.environ["PATH"] = cls.old_path
os.environ["HOME"] = cls.old_home
# safety check
- assert cls.tempdir.startswith('/tmp/leap_tests-')
+ assert 'leap_tests-' in cls.tempdir
shutil.rmtree(cls.tempdir)
def setUp(self):
diff --git a/src/leap/mail/smtp/tests/__init__.py b/src/leap/mail/smtp/tests/__init__.py
index 1459cea..dc24293 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) if gpg_path is not None else "/usr/bin/gpg"
+
+
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
@@ -148,7 +154,7 @@ class TestCaseWithKeyManager(BaseLeapTest):
os.environ["PATH"] = self.old_path
os.environ["HOME"] = self.old_home
# safety check
- assert self.tempdir.startswith('/tmp/leap_tests-')
+ assert 'leap_tests-' in self.tempdir
shutil.rmtree(self.tempdir)