summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-011-wallace_resources.py
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-03-04 16:14:50 -0500
committerThomas Bruederli <bruederli@kolabsys.com>2014-03-04 16:14:50 -0500
commit65df5988b84608386dd0b56c6e60e3eb9a67e83e (patch)
tree3e448eb37dc013679b3a2497d388e98d686d7394 /tests/unit/test-011-wallace_resources.py
parenta4c05082d6b365da9bc4ad138278d682bc1bce80 (diff)
downloadpykolab-65df5988b84608386dd0b56c6e60e3eb9a67e83e.tar.gz
Ignore invalid iTip messages but not fail on them
Diffstat (limited to 'tests/unit/test-011-wallace_resources.py')
-rw-r--r--tests/unit/test-011-wallace_resources.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/unit/test-011-wallace_resources.py b/tests/unit/test-011-wallace_resources.py
index 204df06..50fdc6b 100644
--- a/tests/unit/test-011-wallace_resources.py
+++ b/tests/unit/test-011-wallace_resources.py
@@ -305,6 +305,15 @@ class TestWallaceResources(unittest.TestCase):
itips5 = module_resources.itip_events_from_message(message_from_string(itip_empty))
self.assertEqual(len(itips5), 0, "Simple plain text message")
+ # invalid itip blocks
+ self.assertRaises(Exception, module_resources.itip_events_from_message, message_from_string(itip_multipart.replace("BEGIN:VEVENT", "")))
+
+ itips6 = module_resources.itip_events_from_message(message_from_string(itip_multipart.replace("DTSTART;", "X-DTSTART;")))
+ self.assertEqual(len(itips6), 0, "Event with not DTSTART")
+
+ itips7 = module_resources.itip_events_from_message(message_from_string(itip_non_multipart.replace("METHOD:REQUEST", "METHOD:PUBLISH").replace("method=REQUEST", "method=PUBLISH")))
+ self.assertEqual(len(itips7), 0, "Invalid METHOD")
+
def test_002_resource_record_from_email_address(self):
res = module_resources.resource_record_from_email_address("doe@example.org")