当前位置: 首页>>代码示例>>Python>>正文


Python Conference.addOwner方法代码示例

本文整理汇总了Python中MaKaC.conference.Conference.addOwner方法的典型用法代码示例。如果您正苦于以下问题:Python Conference.addOwner方法的具体用法?Python Conference.addOwner怎么用?Python Conference.addOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MaKaC.conference.Conference的用法示例。


在下文中一共展示了Conference.addOwner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _Needs_Rewriting_TestTimeSchedule

# 需要导入模块: from MaKaC.conference import Conference [as 别名]
# 或者: from MaKaC.conference.Conference import addOwner [as 别名]
class _Needs_Rewriting_TestTimeSchedule(unittest.TestCase):
    """Tests the basic schedule management functions
    """

    def setUp( self ):
        a = Avatar()
        a.setId("creator")
        self._conf = Conference( a )
        self._conf.setId('a')
        category=Category()
        category.setId('1')
        self._conf.addOwner(category)
        catDateIdx = indexes.IndexesHolder().getIndex('categoryDate')
        catDateIdx.indexConf(self._conf)
        self._conf.setTimezone('UTC')

#TODO We need somehow to link schOwner with self._conf (Same thing for the following test
#    def testBasicAddAndRemove( self ):
#        from MaKaC.schedule import TimeSchedule
#        sDateSch,eDateSch=datetime(2004,1,1,10,0, tzinfo=timezone('UTC')),datetime(2004,1,1,12,0, tzinfo=timezone('UTC'))
#        schOwner=_ScheduleOwnerWrapper(sDateSch,eDateSch)
#        sch=TimeSchedule(schOwner)
#        self._conf.addOwner(sch)
#        entry1=IndTimeSchEntry()
#        entry1.setDuration(0,25)
#        entry2=IndTimeSchEntry()
#        entry2.setDuration(0,30)
#        entry3=IndTimeSchEntry()
#        self.assert_(not entry1.isScheduled())
#        self.assert_(not entry2.isScheduled())
#        self.assert_(not entry3.isScheduled())
#        sch.addEntry(entry1)
#        sch.addEntry(entry2)
#        sch.addEntry(entry3)
#        self.assert_(entry1.isScheduled())
#        self.assert_(entry2.isScheduled())
#        self.assert_(entry3.isScheduled())
#        self.assert_(entry1==sch.getEntries()[0])
#        self.assert_(entry2==sch.getEntries()[1])
#        self.assert_(entry3==sch.getEntries()[2])
#        self.assert_(entry1.getStartDate()==datetime(2004,1,1,10,0, tzinfo=timezone('UTC')))
#        self.assert_(entry1.getDuration()==timedelta(minutes=25))
#        self.assert_(entry2.getStartDate()==datetime(2004,1,1,10,25, tzinfo=timezone('UTC')))
#        self.assert_(entry2.getDuration()==timedelta(minutes=30))
#        self.assert_(entry3.getStartDate()==datetime(2004,1,1,10,55, tzinfo=timezone('UTC')))
#        self.assert_(entry3.getDuration()==timedelta(minutes=5))
#        sch.removeEntry(entry1)
#        self.assert_(not entry1.isScheduled())
#        self.assert_(entry2.isScheduled())
#        self.assert_(entry3.isScheduled())
#        self.assert_(entry1 not in sch.getEntries())
#        self.assert_(entry2==sch.getEntries()[0])
#        self.assert_(entry3==sch.getEntries()[1])
#        self.assert_(entry1.getDuration()==timedelta(minutes=25))
#        self.assert_(entry2.getStartDate()==datetime(2004,1,1,10,25, tzinfo=timezone('UTC')))
#        self.assert_(entry2.getDuration()==timedelta(minutes=30))
#        self.assert_(entry3.getStartDate()==datetime(2004,1,1,10,55, tzinfo=timezone('UTC')))
#        self.assert_(entry3.getDuration()==timedelta(minutes=5))

#    def testCompact(self):
#        from MaKaC.schedule import TimeSchedule
#        sDateSch=datetime(2004, 01, 01, 10, 00, tzinfo=timezone('UTC'))
#        eDateSch=datetime(2004, 01, 01, 12, 00, tzinfo=timezone('UTC'))
#        schOwner=_ScheduleOwnerWrapper(sDateSch,eDateSch)
#        sch=TimeSchedule(schOwner)
#        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')))
#        sch.addEntry(entry2)
#        self.assert_(entry2.getStartDate()==datetime(2004, 01, 01, 10, 25, tzinfo=timezone('UTC')))
#        sch.addEntry(entry3)
#        self.assert_(entry3.getStartDate()==datetime(2004, 01, 01, 10, 50, tzinfo=timezone('UTC')))
#        entry1.setStartDate(datetime(2004, 01, 01, 11, 00, tzinfo=timezone('UTC')))
#        entry2.setStartDate(datetime(2004, 01, 01, 11, 15, tzinfo=timezone('UTC')))
#        entry3.setStartDate(datetime(2004, 01, 01, 11, 25, tzinfo=timezone('UTC')))
#        self.assert_(entry1.getStartDate()==datetime(2004, 01, 01, 11, 00, tzinfo=timezone('UTC')))
#        self.assert_(entry2.getStartDate()==datetime(2004, 01, 01, 11, 15, tzinfo=timezone('UTC')))
#        self.assert_(entry3.getStartDate()==datetime(2004, 01, 01, 11, 25, tzinfo=timezone('UTC')))
#        sch.compact()
#        self.assert_(entry1.getStartDate()==datetime(2004 ,01, 01, 10, 00, tzinfo=timezone('UTC')))
#        self.assert_(entry1.getDuration()==timedelta(minutes=25))
#        self.assert_(entry2.getStartDate()==datetime(2004, 01, 01, 10, 25, tzinfo=timezone('UTC')))
#        self.assert_(entry2.getDuration()==timedelta(minutes=25))
#        self.assert_(entry3.getStartDate()==datetime(2004, 01, 01, 10, 50, tzinfo=timezone('UTC')))
#        self.assert_(entry3.getDuration()==timedelta(minutes=30))

    def testStartEndDates(self):
        from MaKaC.schedule import TimeSchedule
        sDateSch,eDateSch=datetime(2004,1,1,10,0, tzinfo=timezone('UTC')),datetime(2004,1,1,12,0, tzinfo=timezone('UTC'))
        schOwner=_ScheduleOwnerWrapper(sDateSch,eDateSch)
        sch=TimeSchedule(schOwner)
        self.assert_(sch.getStartDate()==schOwner.getStartDate())
        self.assert_(sch.getEndDate()==schOwner.getEndDate())
        schOwner.setStartDate(datetime(2004, 01, 02, 10, 00, tzinfo=timezone('UTC')))
开发者ID:VishrutMehta,项目名称:indico,代码行数:101,代码来源:schedule_test.py


注:本文中的MaKaC.conference.Conference.addOwner方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。