summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-018-note.py
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/unit/test-018-note.py
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/unit/test-018-note.py')
-rw-r--r--tests/unit/test-018-note.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/unit/test-018-note.py b/tests/unit/test-018-note.py
index dca077f..7a7bddf 100644
--- a/tests/unit/test-018-note.py
+++ b/tests/unit/test-018-note.py
@@ -25,7 +25,9 @@ xml_note = """
</note>
"""
+
class TestNoteXML(unittest.TestCase):
+
def assertIsInstance(self, _value, _type):
if hasattr(unittest.TestCase, 'assertIsInstance'):
return unittest.TestCase.assertIsInstance(self, _value, _type)
@@ -33,7 +35,7 @@ class TestNoteXML(unittest.TestCase):
if (type(_value)) == _type:
return True
else:
- raise AssertionError, "%s != %s" % (type(_value), _type)
+ raise AssertionError("%s != %s" % (type(_value), _type))
def test_001_minimal(self):
note = Note()
@@ -82,7 +84,7 @@ class TestNoteXML(unittest.TestCase):
data = note_from_string(xml_note).to_dict()
self.assertIsInstance(data, dict)
- self.assertTrue(data.has_key('uid'))
+ self.assertTrue('uid' in data)
self.assertIsInstance(data.get('created', None), datetime.datetime)
self.assertIsInstance(data.get('lastmodified-date', None), datetime.datetime)
self.assertEqual(data.get('summary', None), "Kolab Note")
@@ -91,6 +93,5 @@ class TestNoteXML(unittest.TestCase):
self.assertEqual(len(data.get('categories', None)), 2)
self.assertTrue('<p>This is a HTML note</p>' in data.get('description', None))
-
if __name__ == '__main__':
unittest.main()