Changeset View
Changeset View
Standalone View
Standalone View
tests/unit/test-017-diff.py
Show First 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | <components> | ||||
</attach> | </attach> | ||||
</properties> | </properties> | ||||
</vtodo> | </vtodo> | ||||
</components> | </components> | ||||
</vcalendar> | </vcalendar> | ||||
</icalendar> | </icalendar> | ||||
""" | """ | ||||
class TestComputeDiff(unittest.TestCase): | class TestComputeDiff(unittest.TestCase): | ||||
def test_000_order_proplists(self): | def test_000_order_proplists(self): | ||||
one = { | one = { | ||||
"uri": "cid:one", | "uri": "cid:one", | ||||
"label": "one.txt" | "label": "one.txt" | ||||
} | } | ||||
two = { | two = { | ||||
"uri": "cid:two", | "uri": "cid:two", | ||||
"label": "two.png" | "label": "two.png" | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | def test_001_attachments(self): | ||||
self.assertEqual(diff[2]['new'], 'New attachments') | self.assertEqual(diff[2]['new'], 'New attachments') | ||||
self.assertEqual(diff[3]['property'], 'attach') | self.assertEqual(diff[3]['property'], 'attach') | ||||
self.assertEqual(diff[3]['new'], None) | self.assertEqual(diff[3]['new'], None) | ||||
self.assertEqual(diff[3]['old']['uri'], "cid:silhouette.1427297477.7514.png") | self.assertEqual(diff[3]['old']['uri'], "cid:silhouette.1427297477.7514.png") | ||||
self.assertEqual(diff[4]['property'], 'lastmodified-date') | self.assertEqual(diff[4]['property'], 'lastmodified-date') | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
unittest.main() | unittest.main() | ||||
No newline at end of file |