Python Unit Testing Threaded Pipe