示例#1
0
	def testDefaultSettingOfOnePlayack(self):
		"""Ensure that we play back only one time"""
		policy = FixedCountPolicy()
		self.failIf(policy.hasBeenPlayedBack)
		self.failIf(policy.isReadyForRemoval)
		policy.playback()
		self.failUnless(policy.hasBeenPlayedBack)
		self.failUnless(policy.isReadyForRemoval)
示例#2
0
	def testSettingCountsCorrectlyPlaysBack(self):
		"""Setting the playback count works"""
		policy = FixedCountPolicy(2)
		for x in [1, 2]:
			self.failIf(policy.hasBeenPlayedBack)
			self.failIf(policy.isReadyForRemoval)
			policy.playback()
		self.failUnless(policy.hasBeenPlayedBack)
		self.failUnless(policy.isReadyForRemoval)
示例#3
0
	def testTooManyPlaybacksRaisesAnException(self):
		"""Too many playback raises an exception"""
		policy = FixedCountPolicy()
		policy.playback()
		self.failUnlessRaises(RecordedCallsWereNotReplayedCorrectly, policy.playback)