in reply to Re: Re: Best Approach: package module tests with tcp
in thread Best Approach: package module tests with tcp
If something's hard to test, that's a sign that it could be simpler. Break it into smaller pieces based on logical behavior. If you have a function that connects to a socket and logs some data and prints some data, turn it into three functions.
I'd start with the functions that only expect a live socket connection to be passed in, mock one up, and see what happens there.
|
|---|