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 __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)
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)