Exemplo n.º 1
0
	def __init__( self , * args , ** kwargs ):
		expectation = lookupExpectationsInScenario( self._VOODOO_PATH )[ 0 ]
		expectation.compare( args, kwargs )
		completeExpectation( expectation )
		self.__dict__[ '_voodooPath' ] = expectation.voodooPath()
		self.voodooObjects.append( self )
		expectation.returnValue()
Exemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     expectation = lookupExpectationsInScenario(self._VOODOO_PATH)[0]
     expectation.compare(args, kwargs)
     completeExpectation(expectation)
     self.__dict__['_voodooPath'] = expectation.voodooPath()
     self.voodooObjects.append(self)
     expectation.returnValue()
 def __call__(self, *args, **kwargs):
     voodooPath = self.__dict__["_voodooPath"]
     expectations = lookupExpectationsInScenario(voodooPath)
     TS_ASSERT_LESS_THAN(0, expectations)
     exceptions = []
     for expectation in expectations:
         try:
             expectation.compare(args, kwargs)
             completeExpectation(expectation)
             return expectation.returnValue()
         except VoodooException, e:
             exceptions.append(e)
Exemplo n.º 4
0
 def __call__(self, *args, **kwargs):
     voodooPath = self.__dict__["_voodooPath"]
     expectations = lookupExpectationsInScenario(voodooPath)
     TS_ASSERT_LESS_THAN(0, expectations)
     exceptions = []
     for expectation in expectations:
         try:
             expectation.compare(args, kwargs)
             completeExpectation(expectation)
             return expectation.returnValue()
         except VoodooException, e:
             exceptions.append(e)
 def __setattr__(self, name, value):
     voodooPath = self.__dict__["_voodooPath"]
     expectation = lookupExpectationsInScenario(voodooPath + "." + name)[0]
     TS_ASSERT(expectation._voodooExpectationType.startsWith("SetAttr"))
     expectation.compare(value)
     completeExpectation(expectation)
Exemplo n.º 6
0
 def __setattr__(self, name, value):
     voodooPath = self.__dict__["_voodooPath"]
     expectation = lookupExpectationsInScenario(voodooPath + "." + name)[0]
     TS_ASSERT(expectation._voodooExpectationType.startsWith("SetAttr"))
     expectation.compare(value)
     completeExpectation(expectation)