summaryrefslogtreecommitdiffstats
path: root/tests/functional/test_kolabd
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-05-04 15:53:48 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-05-04 15:53:48 +0200
commitc204eaaa2c9a006432fe00489a352833143db01d (patch)
tree18860f2e335b9a98d34f404d5c4b81d22f2ce222 /tests/functional/test_kolabd
parent4a24e0cc403321713ee1201ade9d36956da1c060 (diff)
downloadpykolab-c204eaaa2c9a006432fe00489a352833143db01d.tar.gz
CS fixes according to PEP8 (ignored mostly line-length errors only)
Summary: . Reviewers: #pykolab_developers Differential Revision: https://git.kolab.org/D134
Diffstat (limited to 'tests/functional/test_kolabd')
-rw-r--r--tests/functional/test_kolabd/__init__.py1
-rw-r--r--tests/functional/test_kolabd/test_001_user_sync.py10
-rw-r--r--tests/functional/test_kolabd/test_002_user_rename.py4
-rw-r--r--tests/functional/test_kolabd/test_003_two_johns.py2
4 files changed, 9 insertions, 8 deletions
diff --git a/tests/functional/test_kolabd/__init__.py b/tests/functional/test_kolabd/__init__.py
index d7bf27f..d6cdb57 100644
--- a/tests/functional/test_kolabd/__init__.py
+++ b/tests/functional/test_kolabd/__init__.py
@@ -1,5 +1,6 @@
import pykolab
+
def setup_package():
conf = pykolab.getConf()
conf.finalize_conf(fatal=False)
diff --git a/tests/functional/test_kolabd/test_001_user_sync.py b/tests/functional/test_kolabd/test_001_user_sync.py
index 671188a..e8c804d 100644
--- a/tests/functional/test_kolabd/test_001_user_sync.py
+++ b/tests/functional/test_kolabd/test_001_user_sync.py
@@ -8,6 +8,7 @@ from pykolab.imap import IMAP
conf = pykolab.getConf()
+
class TestKolabDaemon(unittest.TestCase):
@classmethod
def setup_class(self, *args, **kw):
@@ -61,7 +62,7 @@ class TestKolabDaemon(unittest.TestCase):
result = wap_client.user_info(recipient)
- if not result.has_key('mailhost'):
+ if 'mailhost' not in result:
from tests.functional.synchronize import synchronize_once
synchronize_once()
@@ -106,14 +107,14 @@ class TestKolabDaemon(unittest.TestCase):
print metadata
folder_name = '/'.join(folder.split('/')[2:]).split('@')[0]
- if ac_folders.has_key(folder_name):
- if ac_folders[folder_name].has_key('annotations'):
+ if folder_name in ac_folders:
+ if 'annotations' in ac_folders[folder_name]:
for _annotation in ac_folders[folder_name]['annotations'].keys():
if _annotation.startswith('/private'):
continue
_annotation_value = ac_folders[folder_name]['annotations'][_annotation]
- self.assertTrue(metadata[metadata.keys().pop()].has_key(_annotation))
+ self.assertTrue(_annotation in metadata[metadata.keys().pop()])
self.assertEqual(_annotation_value, metadata[metadata.keys().pop()][_annotation])
def test_006_user_subscriptions(self):
@@ -137,4 +138,3 @@ class TestKolabDaemon(unittest.TestCase):
def test_013_resource_mailbox_annotation(self):
pass
-
diff --git a/tests/functional/test_kolabd/test_002_user_rename.py b/tests/functional/test_kolabd/test_002_user_rename.py
index f526ade..3ac4a02 100644
--- a/tests/functional/test_kolabd/test_002_user_rename.py
+++ b/tests/functional/test_kolabd/test_002_user_rename.py
@@ -8,6 +8,7 @@ from pykolab.imap import IMAP
conf = pykolab.getConf()
+
class TestKolabDaemon(unittest.TestCase):
@classmethod
def setup_class(self, *args, **kw):
@@ -39,7 +40,7 @@ class TestKolabDaemon(unittest.TestCase):
recipient = auth.find_recipient('john.doe@example.org')
user_info = wap_client.user_info(recipient)
- if not user_info.has_key('mailhost'):
+ if 'mailhost' not in user_info:
from tests.functional.synchronize import synchronize_once
synchronize_once()
@@ -77,4 +78,3 @@ class TestKolabDaemon(unittest.TestCase):
folders = imap.lm('user/joe.sixpack@example.org')
self.assertEqual(len(folders), 1, "INBOX for joe.sixpack does not exist")
-
diff --git a/tests/functional/test_kolabd/test_003_two_johns.py b/tests/functional/test_kolabd/test_003_two_johns.py
index b2bfb46..0f93969 100644
--- a/tests/functional/test_kolabd/test_003_two_johns.py
+++ b/tests/functional/test_kolabd/test_003_two_johns.py
@@ -8,6 +8,7 @@ from pykolab.imap import IMAP
conf = pykolab.getConf()
+
class TestKolabDaemon(unittest.TestCase):
@classmethod
def setup_class(self, *args, **kw):
@@ -48,4 +49,3 @@ class TestKolabDaemon(unittest.TestCase):
folders = imap.lm('user/john.doe2@example.org')
self.assertEqual(len(folders), 1, "No INBOX found for second John")
-