summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pykolab/xml/event.py4
-rw-r--r--tests/unit/test-003-event.py2
2 files changed, 6 insertions, 0 deletions
diff --git a/pykolab/xml/event.py b/pykolab/xml/event.py
index 7b9e13c..30b754f 100644
--- a/pykolab/xml/event.py
+++ b/pykolab/xml/event.py
@@ -534,6 +534,10 @@ class Event(object):
return self._translate_value(status, self.status_map) if status else None
+ def get_ical_class(self):
+ class_ = self.event.classification()
+ return self._translate_value(class_, self.classification_map) if class_ else None
+
def get_ical_sequence(self):
return str(self.event.sequence()) if self.event.sequence() else None
diff --git a/tests/unit/test-003-event.py b/tests/unit/test-003-event.py
index 7124e0c..7fae6eb 100644
--- a/tests/unit/test-003-event.py
+++ b/tests/unit/test-003-event.py
@@ -434,6 +434,7 @@ END:VEVENT
self.event.set_start(datetime.datetime(2014, 05, 23, 11, 00, 00, tzinfo=pytz.timezone("Europe/London")))
self.event.set_end(datetime.datetime(2014, 05, 23, 12, 30, 00, tzinfo=pytz.timezone("Europe/London")))
self.event.set_sequence(3)
+ self.event.set_classification('CONFIDENTIAL')
self.event.add_custom_property('X-Custom', 'check')
ical = icalendar.Calendar.from_ical(self.event.as_string_itip())
@@ -444,6 +445,7 @@ END:VEVENT
self.assertEqual(event['sequence'], 3)
self.assertEqual(event['X-CUSTOM'], "check")
self.assertIsInstance(event['dtstamp'].dt, datetime.datetime)
+ self.assertEqual(event['class'], "CONFIDENTIAL")
def test_019_to_message_itip(self):
self.event = Event()