TDD OpenDXL: Need a example of using Mock.patch with opendxl connections

  • Can someone create an example of using nose, or python unit test to mock.patch the dxlclient.connect?

    It would also be useful to see tieclient mocked as well.

    This would help speed up development where I dont need actual DXL network to build clients. There are lots of HTTP mocks available, so stubbing service wrappers would be really easy on 3rd party REST side, but I dont have great experience mock.patching random TCP sockets.

  • The Python client project has tests which use nose. They should provide some idea on how to use it with the dxlclient module.

    Regarding the mocks, can you provide more info on what you are trying? You mention mocking dxlclient.connect, but seems like you might also need to mock other calls like sync_request for building your solution.