本文整理匯總了Python中pymock.Controller.playback方法的典型用法代碼示例。如果您正苦於以下問題:Python Controller.playback方法的具體用法?Python Controller.playback怎麽用?Python Controller.playback使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pymock.Controller
的用法示例。
在下文中一共展示了Controller.playback方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testPlayback
# 需要導入模塊: from pymock import Controller [as 別名]
# 或者: from pymock.Controller import playback [as 別名]
def testPlayback(self):
"""Ensure that the playback operates correctly"""
c = Controller()
action = BaseAction('x')
c.actions.append(action)
c.playback(action)
self.failIf(c.actions.contains(action))
self.failUnless(action.playbackPolicy.hasBeenPlayedBack)
self.failUnless(action.playbackPolicy.isReadyForRemoval)
示例2: testPlaybackWithMultipleCounts
# 需要導入模塊: from pymock import Controller [as 別名]
# 或者: from pymock.Controller import playback [as 別名]
def testPlaybackWithMultipleCounts(self):
"""Perform playback with multiple values"""
c = Controller()
action = BaseAction('x')
c.record(action)
c.setCount(2)
self.failIf(action.playbackPolicy.hasBeenPlayedBack)
self.failIf(action.playbackPolicy.isReadyForRemoval)
c.playback(action)
self.failIf(action.playbackPolicy.hasBeenPlayedBack)
self.failIf(action.playbackPolicy.isReadyForRemoval)
c.playback(action)
self.failUnless(action.playbackPolicy.hasBeenPlayedBack)
self.failUnless(action.playbackPolicy.isReadyForRemoval)