def test_enabled(self): userNumber = 13 client = StubClient(userNumber, self.mktemp()) eventer = Eventer(None, self.sim, client, None, **{"enabled": False}) self.assertEqual(eventer.enabled, False) eventer = Eventer(None, self.sim, client, None, **{"enabled": True}) self.assertEqual(eventer.enabled, True)
def test_addEvent(self): """ When there is a normal calendar to add events to, L{Eventer._addEvent} adds an event to it. """ calendar = Calendar(caldavxml.calendar, set(('VEVENT', )), u'personal stuff', u'/cals/personal', None) client = StubClient(31, self.mktemp()) client._calendars.update({calendar.url: calendar}) eventer = Eventer(Clock(), self.sim, client, None) eventer._addEvent() self.assertEquals(len(client._events), 1)
def test_doNotAddEventOnInbox(self): """ When the only calendar is a schedule inbox, no attempt is made to add events on it. """ calendar = Calendar(caldavxml.schedule_inbox, set(), u'inbox', u'/sched/inbox', None) client = StubClient(21, self.mktemp()) client._calendars.update({calendar.url: calendar}) eventer = Eventer(None, self.sim, client, None) eventer._addEvent() self.assertEquals(client._events, {})
def test_doNotAddEventOnInbox(self): """ When the only calendar is a schedule inbox, no attempt is made to add events on it. """ calendar = Calendar( caldavxml.schedule_inbox, set(), u'inbox', u'/sched/inbox', None) client = StubClient(21, self.mktemp()) client._calendars.update({calendar.url: calendar}) eventer = Eventer(None, self.sim, client, None) eventer._addEvent() self.assertEquals(client._events, {})
def test_addEvent(self): """ When there is a normal calendar to add events to, L{Eventer._addEvent} adds an event to it. """ calendar = Calendar( caldavxml.calendar, set(('VEVENT',)), u'personal stuff', u'/cals/personal', None) client = StubClient(31, self.mktemp()) client._calendars.update({calendar.url: calendar}) eventer = Eventer(Clock(), self.sim, client, None) eventer._addEvent() self.assertEquals(len(client._events), 1)