test code for python pty module