Open m-kostrzewa opened 6 years ago
This is a great question - I would like to know the answer as well. My guess is a well-placed MagicMock would allow you to provide your own mocked objects. I suspect due to the generated nature of the code there's probably one method in VmomiSupport that instantiates all Managed Objects or Data Objects.
Hello,
I want to unit test my code that uses pyvmomi. I don't want it have any side effects or for it to make any requests. I don't really want to use replay tests for testing my own code either.
I'm having a hard time coming up with a way to mock this API. I'm looking at
SoapStubAdapter
class wondering whether I can just mock itsInvokeMethod
to not do anything except return what I want.Of course, this leads to many more problems. Is there a way to do this?