Example #1
0
	def testSetCount(self):
		"""Verify that settting the count works"""
		c = Controller()
		a = BaseAction('x')
		c.record(a)
		self.failUnless(a.playbackPolicy.remaining == 1)
		c.setCount(2)
		self.failUnless(a.playbackPolicy.remaining == 2)
Example #2
0
	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)
Example #3
0
	def testSpecifyingMultiCounts(self):
		"""Specify multi counts for a single argument"""
	
		c = Controller()
		x = c.mock(KlassBeingMocked)
		x.w = 5
		c.setCount(2)
		c.replay()
		x.w = 5
		x.w = 5
		try:
			x.w = 5
			self.fail()
		except PlaybackFailure, e:
			pass