diff options
author | mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> | 2009-07-11 00:13:41 +0000 |
---|---|---|
committer | mbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4> | 2009-07-11 00:13:41 +0000 |
commit | 78b48810bd1a3e71a070c0fcc23af33cac83d17c (patch) | |
tree | 362e6b3cbfa8e40c9c6e6e66f9509f54027e8282 /tko/parsers/test/new_scenario.py | |
parent | 28cd027c2c930661dcd328057e967adf6faa1c6f (diff) |
Update parser unittests to use autotemp
Signed-off-by: Scott Zawalski <scottz@google.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@3397 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko/parsers/test/new_scenario.py')
-rw-r--r-- | tko/parsers/test/new_scenario.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tko/parsers/test/new_scenario.py b/tko/parsers/test/new_scenario.py index 37efdcfc..134626ee 100644 --- a/tko/parsers/test/new_scenario.py +++ b/tko/parsers/test/new_scenario.py @@ -17,11 +17,12 @@ While much is done automatically, a scenario harness is meant to be easily extended and configured once generated. """ -import optparse, os, shutil, sys, tempfile +import optparse, os, shutil, sys from os import path import common from autotest_lib.tko.parsers.test import scenario_base +from autotest_lib.client.common_lib import autotemp usage = 'usage: %prog [options] results_dirpath scenerios_dirpath' parser = optparse.OptionParser(usage=usage) @@ -74,8 +75,8 @@ def main(): os.mkdir(scenario_package_dirpath) # Create tmp_dir - tmp_dirpath = tempfile.mkdtemp() - copied_dirpath = path.join(tmp_dirpath, results_dirname) + tmp_dirpath = autotemp.tempdir(unique_id='new_scenario') + copied_dirpath = path.join(tmp_dirpath.name, results_dirname) # Copy results_dir shutil.copytree(results_dirpath, copied_dirpath) @@ -103,6 +104,7 @@ def main(): scenario_base.install_unittest_module( scenario_package_dirpath, options.template_type) + tmp_dirpath.clean() if __name__ == '__main__': |