コード例 #1
0
    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)
コード例 #2
0
    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)
コード例 #3
0
    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, {})
コード例 #4
0
    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, {})
コード例 #5
0
    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)