當前位置: 首頁>>代碼示例>>Python>>正文


Python Conference.addTrack方法代碼示例

本文整理匯總了Python中MaKaC.conference.Conference.addTrack方法的典型用法代碼示例。如果您正苦於以下問題:Python Conference.addTrack方法的具體用法?Python Conference.addTrack怎麽用?Python Conference.addTrack使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MaKaC.conference.Conference的用法示例。


在下文中一共展示了Conference.addTrack方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: TestRemoveTrackCoordinator

# 需要導入模塊: from MaKaC.conference import Conference [as 別名]
# 或者: from MaKaC.conference.Conference import addTrack [as 別名]
class TestRemoveTrackCoordinator( unittest.TestCase ):
    """Tests different scenarios of the Remove Track Coord use case.
    """
    
    def setUp( self ):
        from MaKaC.user import Avatar
        cr = Avatar()
        cr.setId( "creator" )
        from MaKaC.conference import Conference, Track
        self._conf = Conference( cr )
        self._track1 = Track()
        self._track1.setId( "1" )
        self._conf.addTrack( self._track1 )
        
    def tearDown( self ):
        pass

    def testRemoveTC( self ):
        from MaKaC.user import Avatar
        tc1 = Avatar()
        tc1.setId( "tc1" )
        tc2 = Avatar()
        tc2.setId( "tc2" )
        self._track1.addCoordinator( tc1 )
        self._track1.addCoordinator( tc2 )
        self._track1.removeCoordinator( tc1 )
        self.assert_( tc1 not in self._track1.getCoordinatorList() )
        self.assert_( tc2 in self._track1.getCoordinatorList() )
        self.assert_( self._track1 not in self._conf.getCoordinatedTracks( tc1 ) )
        self.assert_( self._track1 in self._conf.getCoordinatedTracks( tc2 ) )
開發者ID:lukasnellen,項目名稱:indico,代碼行數:32,代碼來源:testSciProgramme.py

示例2: TestContributionInclusion

# 需要導入模塊: from MaKaC.conference import Conference [as 別名]
# 或者: from MaKaC.conference.Conference import addTrack [as 別名]
class TestContributionInclusion( unittest.TestCase ):
    
    def setUp( self ):
        from MaKaC.user import Avatar
        cr = Avatar()
        cr.setId( "creator" )
        from MaKaC.conference import Conference, Track
        self._conf = Conference( cr )
        self._track1 = Track()
        self._track1.setId( "1" )
        self._conf.addTrack( self._track1 )

    def test( self ):
        from MaKaC.conference import Contribution
        contrib1 = Contribution()
        self._conf.addContribution( contrib1 )
        self._track1.addContribution( contrib1 )
        self.assert_( self._track1.hasContribution( contrib1 ) )
        self.assert_( contrib1.getTrack() == track1 )
        self._track1.removeContribution( contrib1 )
        self.assert_( not self._track1.hasContribution( contrib1 ) )
        self.assert_( contrib1.getTrack() == None )
開發者ID:lukasnellen,項目名稱:indico,代碼行數:24,代碼來源:testSciProgramme.py


注:本文中的MaKaC.conference.Conference.addTrack方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。