예제 #1
0
	def testOnePlaybacksIsTheDefault(self):
		"""Ensure that we must play back at least once"""
		policy = MinimumPlaybackPolicy()
		self.failIf(policy.hasBeenPlayedBack)
		self.failIf(policy.isReadyForRemoval)
		policy.playback()
		self.failUnless(policy.hasBeenPlayedBack)
		self.failIf(policy.isReadyForRemoval)
예제 #2
0
	def testVerifyArbitraryLimits(self):
		"""Ensure that we can require arbitrary minimum playback limits"""
		policy = MinimumPlaybackPolicy(3)
		for x in range(0, 3):
			self.failIf(policy.hasBeenPlayedBack)
			self.failIf(policy.isReadyForRemoval)
			policy.playback()
		self.failUnless(policy.hasBeenPlayedBack)
		self.failIf(policy.isReadyForRemoval)