I have a software made of two halves: one is python running on a first pc, the other is cpp running on a second one. They communicate through the serial port (tty).
I would like to test the python side on my pc, feeding it with the proper data and see if it behaves as expected.
I started using subprocess but then came the problem: which stdin and stdout should I supply?
cStringIO
does not work because there is no fileno()
PIPE doesn't work either because select.select()
says there is something to read even if nothing it's actually sent
Do you have any hints? Is there a fake tty module I can use?