Closed mehulkar closed 7 years ago
Not directly, but I think this will work:
expect(my_object).some_method.and_return_result_of(my_object.some_method)
You can also do:
def temp(*args, **kwargs):
# do some stuff
expect(my_object).some_method.and_return_result_of(temp)
ah, very nice. thank you!
I would like to be able to set an expectation that
shutil.copytree
is called (or any other module that involves the outside system).Right now, i can either stub using the method
allow
or expect it to be called usingexpect
, but I can't see how to do both. I see from the docs that the purpose of a stub is to set a return value, but I would like to set an expectation that also stubs out the behavior. Inrspec
(ruby world) this is done like this:Is this possible in this library?