def should_wrap_modulefunctions(self): '''Wrapping module functions and instance methods should be possible''' spec = Spec(WrapFunction(None, number_one, 'number_one')) spec.when(spec.__call__()).then(spec.result()).should_be(1)
def should_wrap_modulefunctions(self): """Wrapping module functions and instance methods should be possible""" spec = Spec(WrapFunction(None, number_one, "number_one")) spec.when(spec.__call__()).then(spec.result()).should_be(1)
def result_invoke_underlying(self): '''result() should invoke the wrapped function and return its result''' spec = Spec(WrapFunction(None, 'a', 'startswith')) spec.when(spec.__call__('a')).then(spec.result()).should_be(True) spec.when(spec.__call__('b')).then(spec.result()).should_be(False)
def result_invoke_underlying(self): """result() should invoke the wrapped function and return its result""" spec = Spec(WrapFunction(None, "a", "startswith")) spec.when(spec.__call__("a")).then(spec.result()).should_be(True) spec.when(spec.__call__("b")).then(spec.result()).should_be(False)