def test_event_delegated(self): e = kolabformat.Event() e.setSummary("test") e.setStart(kolabformat.cDateTime(2014,7,1, 12,30,0)) att1 = kolabformat.Attendee(kolabformat.ContactReference("*****@*****.**")) att1.setRole(kolabformat.NonParticipant) att1.setPartStat(kolabformat.PartDelegated) att1.setDelegatedTo([kolabformat.ContactReference("*****@*****.**")]) att2 = kolabformat.Attendee(kolabformat.ContactReference("*****@*****.**")) att2.setRole(kolabformat.Required) att2.setPartStat(kolabformat.PartNeedsAction) att2.setDelegatedFrom([kolabformat.ContactReference("*****@*****.**")]) e.setAttendees([att1, att2]) self.assertEqual(len(att1.delegatedTo()), 1) self.assertEqual(len(att2.delegatedFrom()), 1) xml = kolabformat.writeEvent(e) e1 = kolabformat.readEvent(xml, False) # print xml attendees_ = e1.attendees() self.assertEqual(len(attendees_), 2) self.assertEqual(len(attendees_[0].delegatedTo()), 1) self.assertEqual(len(attendees_[1].delegatedFrom()), 1) delegatees = attendees_[0].delegatedTo() self.assertEqual(delegatees[0].email(), "*****@*****.**")
def test_event_delegated(self): e = kolabformat.Event() e.setSummary("test") e.setStart(kolabformat.cDateTime(2014, 7, 1, 12, 30, 0)) att1 = kolabformat.Attendee( kolabformat.ContactReference("*****@*****.**")) att1.setRole(kolabformat.NonParticipant) att1.setPartStat(kolabformat.PartDelegated) att1.setDelegatedTo([kolabformat.ContactReference("*****@*****.**")]) att2 = kolabformat.Attendee( kolabformat.ContactReference("*****@*****.**")) att2.setRole(kolabformat.Required) att2.setPartStat(kolabformat.PartNeedsAction) att2.setDelegatedFrom([kolabformat.ContactReference("*****@*****.**")]) e.setAttendees([att1, att2]) self.assertEqual(len(att1.delegatedTo()), 1) self.assertEqual(len(att2.delegatedFrom()), 1) xml = kolabformat.writeEvent(e) e1 = kolabformat.readEvent(xml, False) # print xml attendees_ = e1.attendees() self.assertEqual(len(attendees_), 2) self.assertEqual(len(attendees_[0].delegatedTo()), 1) self.assertEqual(len(attendees_[1].delegatedFrom()), 1) delegatees = attendees_[0].delegatedTo() self.assertEqual(delegatees[0].email(), "*****@*****.**")
def __str__(self): event_xml = kolabformat.writeEvent(self.event) error = kolabformat.error() if error == None or not error: return event_xml else: raise EventIntegrityError, kolabformat.errorMessage()
def test_event_basic(self): e = kolabformat.Event() e.setSummary("test") start = kolabformat.cDateTime(2014,7,1, 12,30,0) start.setTimezone("Europe/London") e.setStart(start) ex = e.exceptionDates() ex.size() ex.push_back(kolabformat.cDateTime(2014,7,5)) ex.size() e.exceptionDates().size() e.setExceptionDates(ex) e.exceptionDates().size() xml = kolabformat.writeEvent(e) e1 = kolabformat.readEvent(xml, False) xml1 = kolabformat.writeEvent(e1) self.assertEqual(xml, xml1)
def test_event_basic(self): e = kolabformat.Event() e.setSummary("test") start = kolabformat.cDateTime(2014, 7, 1, 12, 30, 0) start.setTimezone("Europe/London") e.setStart(start) ex = e.exceptionDates() ex.size() ex.push_back(kolabformat.cDateTime(2014, 7, 5)) ex.size() e.exceptionDates().size() e.setExceptionDates(ex) e.exceptionDates().size() xml = kolabformat.writeEvent(e) e1 = kolabformat.readEvent(xml, False) xml1 = kolabformat.writeEvent(e1) self.assertEqual(xml, xml1)
import kolabformat e = kolabformat.Event() ex = e.exceptionDates() ex.size() ex.push_back(kolabformat.cDateTime(1,1,1)) ex.size() e.exceptionDates().size() e.setExceptionDates(ex) e.exceptionDates().size() string = kolabformat.writeEvent(e); print string; e1 = kolabformat.readEvent(string, False); string = kolabformat.writeEvent(e1); print string;