I have function func1 which creates a bytesio object and passes to func2. func2 writes to the bytesio object but never returns it. How to mock func2 when unit testing func1.