Subject: new Twill command: runonce
From: Matthew Good <ma...@matt-good.net>
To: ti...@idyll.org
Date: Mon, 03 Apr 2006 18:38:35 -0400
X-Mailer: Evolution 2.6.0
I've finally gotten around to writing some twill scripts for testing one
of my projects. I've written a small command "runonce" that is
basically like "runfile", but only runs each command one time within the
current process. This way I can create independent test scripts that
will run the login script at the beginning, but when they're executed in
sequence from a "run-all" script the login is only executed the first
time.
Feel free to do with it as you see fit, or let me know if there's a
better way.
--
Matthew Good <ma...@matt-good.net>
__all__ = ['runonce']
try:
set
except NameError:
from sets import Set as set
_files_run = set()
def runonce(files):
global _files_run
import twill.parse
for f in files.split(' '):
if f in _files_run:
continue
twill.parse.execute_file(f, no_reset=True)
_files_run.add(f)
----- End forwarded message -----
--
C. Titus Brown, c...@msu.edu