summaryrefslogtreecommitdiffstats
path: root/tests/unit/test-003-event.py
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-07-25 23:09:54 -0400
committerThomas Bruederli <bruederli@kolabsys.com>2014-07-25 23:09:54 -0400
commita60e0128a79fa02add67c517538946a772deaf23 (patch)
tree439f435f73b0c6015574ff304203d3faf2029410 /tests/unit/test-003-event.py
parentf29b67ff6973447de96eeeb465884fc1a51c49ef (diff)
downloadpykolab-a60e0128a79fa02add67c517538946a772deaf23.tar.gz
Finish dump of event alarms as dict
Diffstat (limited to 'tests/unit/test-003-event.py')
-rw-r--r--tests/unit/test-003-event.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/unit/test-003-event.py b/tests/unit/test-003-event.py
index 5017091..f069be3 100644
--- a/tests/unit/test-003-event.py
+++ b/tests/unit/test-003-event.py
@@ -190,6 +190,50 @@ xml_event = """
<value>BUSY</value>
</x-custom>
</properties>
+ <components>
+ <valarm>
+ <properties>
+ <action>
+ <text>DISPLAY</text>
+ </action>
+ <description>
+ <text>alarm 1</text>
+ </description>
+ <trigger>
+ <parameters>
+ <related>
+ <text>START</text>
+ </related>
+ </parameters>
+ <duration>-PT2H</duration>
+ </trigger>
+ </properties>
+ </valarm>
+ <valarm>
+ <properties>
+ <action>
+ <text>EMAIL</text>
+ </action>
+ <summary>
+ <text>test</text>
+ </summary>
+ <description>
+ <text>alarm 2</text>
+ </description>
+ <attendee>
+ <cal-address>mailto:%3Cjohn.die%40example.org%3E</cal-address>
+ </attendee>
+ <trigger>
+ <parameters>
+ <related>
+ <text>START</text>
+ </related>
+ </parameters>
+ <duration>-P1D</duration>
+ </trigger>
+ </properties>
+ </valarm>
+ </components>
</vevent>
</components>
</vcalendar>
@@ -520,6 +564,13 @@ END:VEVENT
self.assertEqual(data['rrule']['wkst'], 'MO')
self.assertIsInstance(data['rrule']['until'], datetime.date)
+ self.assertIsInstance(data['alarm'], list)
+ self.assertEqual(len(data['alarm']), 2)
+ self.assertEqual(data['alarm'][0]['action'], 'DISPLAY')
+ self.assertEqual(data['alarm'][1]['action'], 'EMAIL')
+ self.assertEqual(data['alarm'][1]['trigger']['value'], '-P1D')
+ self.assertEqual(len(data['alarm'][1]['attendee']), 1)
+
if __name__ == '__main__':
unittest.main()