"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "test/basic.py" between
reptyr-reptyr-0.7.0.tar.gz and reptyr-reptyr-0.8.0.tar.gz

About: reptyr is a utility for taking an existing running program and attaching it to a new terminal.

basic.py  (reptyr-reptyr-0.7.0):basic.py  (reptyr-reptyr-0.8.0)
import os
import pexpect import pexpect
import sys import sys
from util import expect_eof
if os.getenv("NO_TEST_BASIC") is not None:
print("Skipping basic tests because $NO_TEST_BASIC is set.")
sys.exit(0)
logfile = sys.stdout
if sys.version_info[0] >= 3:
logfile = logfile.buffer
child = pexpect.spawn("test/victim") child = pexpect.spawn("test/victim")
child.logfile = sys.stdout child.logfile = logfile
child.setecho(False) child.setecho(False)
child.sendline("hello") child.sendline("hello")
child.expect("ECHO: hello") child.expect("ECHO: hello")
reptyr = pexpect.spawn("./reptyr -V %d" % (child.pid,)) reptyr = pexpect.spawn("./reptyr -V %d" % (child.pid,))
reptyr.logfile = sys.stdout reptyr.logfile = logfile
reptyr.sendline("world") reptyr.sendline("world")
reptyr.expect("ECHO: world") reptyr.expect("ECHO: world")
child.sendline("final") child.sendline("final")
child.expect(pexpect.EOF) expect_eof(child.child_fd)
reptyr.sendeof() reptyr.sendeof()
reptyr.expect(pexpect.EOF) reptyr.expect(pexpect.EOF)
assert not reptyr.isalive() assert not reptyr.isalive()
 End of changes. 5 change blocks. 
3 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)