def testPlaybackMechanism(self): """Ensure taht playback is tracked""" x = BaseAction('x') self.failIf(x.playbackPolicy.hasBeenPlayedBack) self.failIf(x.playbackPolicy.isReadyForRemoval) x.playback() self.failUnless(x.playbackPolicy.hasBeenPlayedBack) self.failUnless(x.playbackPolicy.isReadyForRemoval)
def testReturn(self): """Ensure that the default action returns itself when recording""" x = BaseAction('x') self.failUnless(x.record() == x)
def testRaisesException(self): """Ensure that record recorded exceptions are played back""" x = BaseAction('x') x.throws = Exception() self.failUnlessRaises(Exception, x.playback)