summaryrefslogtreecommitdiff
path: root/src/leap/mail/tests/common.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-01-07 12:12:24 -0400
committerKali Kaneko <kali@leap.se>2015-02-11 14:05:43 -0400
commit9c40103a3c3dcdb3e4c4edae9f466f1701e022fc (patch)
treeca7c482e10a8084609816ee4f2c21534cf6da97a /src/leap/mail/tests/common.py
parentf7030295a936cc5da33f50411b5ff60ae0eec7cc (diff)
Complete IMAP implementation, update tests
Diffstat (limited to 'src/leap/mail/tests/common.py')
-rw-r--r--src/leap/mail/tests/common.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/leap/mail/tests/common.py b/src/leap/mail/tests/common.py
index fefa7ee..a411b2d 100644
--- a/src/leap/mail/tests/common.py
+++ b/src/leap/mail/tests/common.py
@@ -21,6 +21,9 @@ import os
import shutil
import tempfile
+from twisted.internet import defer
+from twisted.trial import unittest
+
from leap.common.testing.basetest import BaseLeapTest
from leap.soledad.client import Soledad
@@ -60,7 +63,7 @@ def _initialize_soledad(email, gnupg_home, tempdir):
return soledad
-class SoledadTestMixin(BaseLeapTest):
+class SoledadTestMixin(unittest.TestCase, BaseLeapTest):
"""
It is **VERY** important that this base is added *AFTER* unittest.TestCase
"""
@@ -68,15 +71,7 @@ class SoledadTestMixin(BaseLeapTest):
def setUp(self):
self.results = []
- self.old_path = os.environ['PATH']
- self.old_home = os.environ['HOME']
- self.tempdir = tempfile.mkdtemp(prefix="leap_tests-")
- self.home = self.tempdir
- bin_tdir = os.path.join(
- self.tempdir,
- 'bin')
- os.environ["PATH"] = bin_tdir
- os.environ["HOME"] = self.tempdir
+ self.setUpEnv()
# Soledad: config info
self.gnupg_home = "%s/gnupg" % self.tempdir
@@ -88,6 +83,8 @@ class SoledadTestMixin(BaseLeapTest):
self.gnupg_home,
self.tempdir)
+ return defer.succeed(True)
+
def tearDown(self):
"""
tearDown method called after each test.