summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-10-06 09:43:14 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-10-06 09:43:14 +0200
commit8478ac6830d0002c77ce9b23ca6e1fd35fbec464 (patch)
tree23eb94cbc7df512954c4bfa09d539bb6010328c7 /tests
parentee6b450f2fabebaf18d7e7d7ea36d693ecd546ea (diff)
downloadpykolab-8478ac6830d0002c77ce9b23ca6e1fd35fbec464.tar.gz
T1221: Fix a "race" between Event and Todo properties_map dict
Summary: Fixes T1221 Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Maniphest Tasks: T1221 Differential Revision: https://git.kolab.org/D216
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test-003-event.py4
-rw-r--r--tests/unit/test-017-diff.py19
2 files changed, 12 insertions, 11 deletions
diff --git a/tests/unit/test-003-event.py b/tests/unit/test-003-event.py
index a7ab82f..09ab17d 100644
--- a/tests/unit/test-003-event.py
+++ b/tests/unit/test-003-event.py
@@ -889,7 +889,7 @@ END:VEVENT
self.assertIsInstance(data, dict)
self.assertIsInstance(data['start'], datetime.datetime)
- # self.assertIsInstance(data['end'], datetime.datetime)
+ self.assertIsInstance(data['end'], datetime.datetime)
self.assertIsInstance(data['created'], datetime.datetime)
self.assertIsInstance(data['lastmodified-date'], datetime.datetime)
self.assertEqual(data['uid'], '75c740bb-b3c6-442c-8021-ecbaeb0a025e')
@@ -936,7 +936,7 @@ END:VEVENT
e2.set_lastmodified()
diff = compute_diff(e1.to_dict(), e2.to_dict(), True)
- self.assertEqual(len(diff), 4, "Diff: (length: %d):\r\n%r\r\n%r" % (len(diff), diff, e2.__str__()))
+ self.assertEqual(len(diff), 5, "Diff: (length: %d):\r\n%r\r\n%r" % (len(diff), diff, e2.__str__()))
ps = self._find_prop_in_list(diff, 'summary')
self.assertIsInstance(ps, OrderedDict)
diff --git a/tests/unit/test-017-diff.py b/tests/unit/test-017-diff.py
index 46e0a77..4adbea1 100644
--- a/tests/unit/test-017-diff.py
+++ b/tests/unit/test-017-diff.py
@@ -190,18 +190,19 @@ class TestComputeDiff(unittest.TestCase):
self.assertEqual(diff[0]['old'], 0)
self.assertEqual(diff[0]['new'], 1)
- self.assertEqual(diff[1]['property'], 'description')
- self.assertEqual(diff[1]['old'], '')
+ self.assertEqual(diff[1]['property'], 'summary')
+ self.assertEqual(diff[1]['old'], 'Old attachments')
+ self.assertEqual(diff[1]['new'], 'New attachments')
- self.assertEqual(diff[2]['property'], 'summary')
- self.assertEqual(diff[2]['old'], 'Old attachments')
- self.assertEqual(diff[2]['new'], 'New attachments')
+ self.assertEqual(diff[2]['property'], 'attach')
+ self.assertEqual(diff[2]['new'], None)
+ self.assertEqual(diff[2]['old']['uri'], "cid:silhouette.1427297477.7514.png")
- self.assertEqual(diff[3]['property'], 'attach')
- self.assertEqual(diff[3]['new'], None)
- self.assertEqual(diff[3]['old']['uri'], "cid:silhouette.1427297477.7514.png")
+ self.assertEqual(diff[3]['property'], 'lastmodified-date')
+
+ self.assertEqual(diff[4]['property'], 'description')
+ self.assertEqual(diff[4]['old'], '')
- self.assertEqual(diff[4]['property'], 'lastmodified-date')
if __name__ == '__main__':
unittest.main()