Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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)
Пример #4
0
 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)