Made test execution faster and also a bit more reliable. The remaining problem is the screen stuff command :/
This commit is contained in:
parent
e5715d8d5e
commit
3e34086b8e
10
test.py
10
test.py
@ -75,15 +75,19 @@ EOF
|
||||
|
||||
handle, fn = tempfile.mkstemp(prefix="PySnipEmuTest",suffix=".txt")
|
||||
os.close(handle)
|
||||
os.unlink(fn)
|
||||
|
||||
self.escape()
|
||||
self.send(":w! %s\n" % fn)
|
||||
|
||||
# Give screen a chance to send the cmd and vim to write the file
|
||||
time.sleep(.25)
|
||||
|
||||
# Read the output, chop the trailing newline
|
||||
tries = 50
|
||||
while tries:
|
||||
if os.path.exists(fn):
|
||||
self.output = open(fn,"r").read()[:-1]
|
||||
break
|
||||
time.sleep(.05)
|
||||
tries -= 1
|
||||
|
||||
|
||||
def cmd(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user