summaryrefslogtreecommitdiffstats
path: root/tests/functional
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional')
-rw-r--r--tests/functional/test_kolabd/test_001_user_sync.py4
-rw-r--r--tests/functional/test_wallace/test_001_user_add.py14
-rw-r--r--tests/functional/test_wallace/test_002_footer.py18
-rw-r--r--tests/functional/test_wallace/test_003_nonascii_subject.py18
-rw-r--r--tests/functional/test_wallace/test_004_nonascii_addresses.py18
-rw-r--r--tests/functional/test_wap_client/test_002_user_add.py4
6 files changed, 53 insertions, 23 deletions
diff --git a/tests/functional/test_kolabd/test_001_user_sync.py b/tests/functional/test_kolabd/test_001_user_sync.py
index cf8d443..0652d23 100644
--- a/tests/functional/test_kolabd/test_001_user_sync.py
+++ b/tests/functional/test_kolabd/test_001_user_sync.py
@@ -85,7 +85,7 @@ class TestKolabDaemon(unittest.TestCase):
imap.connect()
ac_folders = conf.get_raw('kolab', 'autocreate_folders')
- exec("ac_folders = %s" % (ac_folders))
+ ac_folders = eval("%s" % (ac_folders))
folders = imap.lm('user/%(local)s/*@%(domain)s' % (self.user))
@@ -96,7 +96,7 @@ class TestKolabDaemon(unittest.TestCase):
imap.connect()
ac_folders = conf.get_raw('kolab', 'autocreate_folders')
- exec("ac_folders = %s" % (ac_folders))
+ ac_folders = eval("%s" % (ac_folders))
folders = []
folders.extend(imap.lm('user/%(local)s@%(domain)s' % (self.user)))
diff --git a/tests/functional/test_wallace/test_001_user_add.py b/tests/functional/test_wallace/test_001_user_add.py
index a6945c9..deff7bb 100644
--- a/tests/functional/test_wallace/test_001_user_add.py
+++ b/tests/functional/test_wallace/test_001_user_add.py
@@ -51,10 +51,16 @@ class TestUserAdd(unittest.TestCase):
def test_002_send_forwarded_email(self):
import smtplib
- from email.MIMEMultipart import MIMEMultipart
- from email.MIMEBase import MIMEBase
- from email.MIMEText import MIMEText
- from email.Utils import COMMASPACE, formatdate
+ if sys.version_info.major >= 3:
+ from email.mime.text import MIMEText
+ from email.mime.base import MIMEBase
+ from email.mime.multipart import MIMEMultipart
+ from email.utils import COMMASPACE, formatdate
+ else:
+ from email.MIMEMultipart import MIMEMultipart
+ from email.MIMEBase import MIMEBase
+ from email.MIMEText import MIMEText
+ from email.Utils import COMMASPACE, formatdate
from email import Encoders
smtp = smtplib.SMTP('localhost', 10026)
diff --git a/tests/functional/test_wallace/test_002_footer.py b/tests/functional/test_wallace/test_002_footer.py
index 5da044a..359ef8b 100644
--- a/tests/functional/test_wallace/test_002_footer.py
+++ b/tests/functional/test_wallace/test_002_footer.py
@@ -1,9 +1,17 @@
+import sys
from email import message_from_string
-from email.MIMEMultipart import MIMEMultipart
-from email.MIMEBase import MIMEBase
-from email.MIMEImage import MIMEImage
-from email.MIMEText import MIMEText
-from email.Utils import COMMASPACE, formatdate
+if sys.version_info.major >= 3:
+ from email.mime.text import MIMEText
+ from email.mime.base import MIMEBase
+ from email.mime.multipart import MIMEMultipart
+ from email.mime.image import MIMEImage
+ from email.utils import COMMASPACE, formatdate
+else:
+ from email.MIMEMultipart import MIMEMultipart
+ from email.MIMEBase import MIMEBase
+ from email.MIMEText import MIMEText
+ from email.MIMEImage import MIMEImage
+ from email.Utils import COMMASPACE, formatdate
from email import Encoders
import os
import smtplib
diff --git a/tests/functional/test_wallace/test_003_nonascii_subject.py b/tests/functional/test_wallace/test_003_nonascii_subject.py
index 87d163a..2b43175 100644
--- a/tests/functional/test_wallace/test_003_nonascii_subject.py
+++ b/tests/functional/test_wallace/test_003_nonascii_subject.py
@@ -1,11 +1,19 @@
# *-* encoding: utf-8 *-*
from email.header import Header
from email import message_from_string
-from email.MIMEMultipart import MIMEMultipart
-from email.MIMEBase import MIMEBase
-from email.MIMEImage import MIMEImage
-from email.MIMEText import MIMEText
-from email.Utils import COMMASPACE, formatdate
+import sys
+if sys.version_info.major >= 3:
+ from email.mime.text import MIMEText
+ from email.mime.base import MIMEBase
+ from email.mime.multipart import MIMEMultipart
+ from email.mime.image import MIMEImage
+ from email.utils import COMMASPACE, formatdate
+else:
+ from email.MIMEMultipart import MIMEMultipart
+ from email.MIMEBase import MIMEBase
+ from email.MIMEText import MIMEText
+ from email.MIMEImage import MIMEImage
+ from email.Utils import COMMASPACE, formatdate
from email import Encoders
import os
import smtplib
diff --git a/tests/functional/test_wallace/test_004_nonascii_addresses.py b/tests/functional/test_wallace/test_004_nonascii_addresses.py
index 42239c4..b4eb940 100644
--- a/tests/functional/test_wallace/test_004_nonascii_addresses.py
+++ b/tests/functional/test_wallace/test_004_nonascii_addresses.py
@@ -1,11 +1,19 @@
# *-* encoding: utf-8 *-*
from email.header import Header
from email import message_from_string
-from email.MIMEMultipart import MIMEMultipart
-from email.MIMEBase import MIMEBase
-from email.MIMEImage import MIMEImage
-from email.MIMEText import MIMEText
-from email.Utils import COMMASPACE, formatdate
+import sys
+if sys.version_info.major >= 3:
+ from email.mime.text import MIMEText
+ from email.mime.base import MIMEBase
+ from email.mime.multipart import MIMEMultipart
+ from email.mime.image import MIMEImage
+ from email.utils import COMMASPACE, formatdate
+else:
+ from email.MIMEMultipart import MIMEMultipart
+ from email.MIMEBase import MIMEBase
+ from email.MIMEText import MIMEText
+ from email.MIMEImage import MIMEImage
+ from email.Utils import COMMASPACE, formatdate
from email import Encoders
import os
import smtplib
diff --git a/tests/functional/test_wap_client/test_002_user_add.py b/tests/functional/test_wap_client/test_002_user_add.py
index a48b92b..865d64d 100644
--- a/tests/functional/test_wap_client/test_002_user_add.py
+++ b/tests/functional/test_wap_client/test_002_user_add.py
@@ -44,7 +44,7 @@ class TestUserAdd(unittest.TestCase):
imap = IMAP()
imap.connect()
- exec("ac_folders = %s" % (conf.get_raw(conf.get('kolab', 'primary_domain'), 'autocreate_folders')))
+ ac_folders = eval("%s" % (conf.get_raw(conf.get('kolab', 'primary_domain'), 'autocreate_folders')))
folders = imap.lm('user/%(local)s/*@%(domain)s' % (self.user))
@@ -57,7 +57,7 @@ class TestUserAdd(unittest.TestCase):
imap = IMAP()
imap.connect()
- exec("ac_folders = %s" % (conf.get_raw(conf.get('kolab', 'primary_domain'), 'autocreate_folders')))
+ ac_folders = eval("%s" % (conf.get_raw(conf.get('kolab', 'primary_domain'), 'autocreate_folders')))
folders = []
folders.extend(imap.lm('user/%(local)s@%(domain)s' % (self.user)))