コード例 #1
0
ファイル: schedule_test.py プロジェクト: VishrutMehta/indico
 def testMoveDown(self):
     from MaKaC.schedule import ConferenceSchedule
     sDateSch=datetime(2004, 01, 01, 10, 00, tzinfo=timezone('UTC'))
     eDateSch=datetime(2004, 01, 01, 12, 00, tzinfo=timezone('UTC'))
     self._conf.setStartDate(sDateSch)
     self._conf.setEndDate(eDateSch)
     sch=ConferenceSchedule(self._conf)
     from MaKaC.schedule import TimeSchEntry
     entry1,entry2=IndTimeSchEntry(),IndTimeSchEntry()
     entry3=IndTimeSchEntry()
     entry1.setDuration(0,25)
     entry2.setDuration(0,25)
     entry3.setDuration(0,30)
     sch.addEntry(entry1)
     self.assert_(entry1.getStartDate()==datetime(2004, 01, 01, 10, 00, tzinfo=timezone('UTC')))
コード例 #2
0
 def testMoveDown(self):
     from MaKaC.schedule import ConferenceSchedule
     sDateSch = datetime(2004, 01, 01, 10, 00, tzinfo=timezone('UTC'))
     eDateSch = datetime(2004, 01, 01, 12, 00, tzinfo=timezone('UTC'))
     self._conf.setStartDate(sDateSch)
     self._conf.setEndDate(eDateSch)
     sch = ConferenceSchedule(self._conf)
     from MaKaC.schedule import TimeSchEntry
     entry1, entry2 = IndTimeSchEntry(), IndTimeSchEntry()
     entry3 = IndTimeSchEntry()
     entry1.setDuration(0, 25)
     entry2.setDuration(0, 25)
     entry3.setDuration(0, 30)
     sch.addEntry(entry1)
     self.assert_(entry1.getStartDate() == datetime(
         2004, 01, 01, 10, 00, tzinfo=timezone('UTC')))
コード例 #3
0
    def _expandNewTest(self, sDate, duration, expSDate, expEDate):
        from MaKaC.schedule import ConferenceSchedule

        schedule = ConferenceSchedule(self._conf)

        contrib = self._addContribToSession(self._session1, sDate, duration)

        # scheduling
        self._slot2.getSchedule().addEntry(contrib.getSchEntry())

        self.assert_(self._slot2.getAdjustedStartDate() == expSDate)
        self.assert_(self._slot2.getAdjustedEndDate() == expEDate)
コード例 #4
0
    def testNewCrossingDoesNotCorruptSessionTime(self):
        """ Session start/end time does not get messed up by new overflowing content """
        from MaKaC.schedule import ConferenceSchedule

        schedule = ConferenceSchedule(self._conf)

        earlyDate = datetime(2009, 9, 21, 16, 0, 0, tzinfo=timezone("UTC"))

        contrib = self._addContribToSession(self._session1, earlyDate, 1)

        # scheduling
        self._slot2.getSchedule().addEntry(contrib.getSchEntry())

        self.assert_(self._session1.getAdjustedStartDate() == earlyDate)
        self.assert_(self._session1.getAdjustedEndDate() == self._slot2_eDate)
コード例 #5
0
    def _expandResizeTest(self, sDate, sDuration, newDate, newDuration,
                          expSDate, expEDate):
        from MaKaC.schedule import ConferenceSchedule

        schedule = ConferenceSchedule(self._conf)

        contrib = self._addContribToSession(self._session1, sDate, sDuration)

        # scheduling
        self._slot2.getSchedule().addEntry(contrib.getSchEntry())

        # changing time
        contrib.setStartDate(newDate)
        contrib.setDuration(dur=timedelta(hours=newDuration))

        self.assert_(self._slot2.getAdjustedStartDate() == expSDate)
        self.assert_(self._slot2.getAdjustedEndDate() == expEDate)