Create temp directories in "test" dir

Don't create the temp dirs in the current directory, but create them in
the same directory as the credentials.conf file is. We still need to
prevent deleting them on test failure, so that they can be inspected
manually.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth 2012-01-18 23:12:27 +01:00
parent bf1f79c571
commit 2776ee1974
1 changed files with 3 additions and 2 deletions

View File

@ -50,9 +50,10 @@ class OLITestLib():
directory at a time. OLITestLib is not suited for running
several tests in parallel. The user is responsible for
cleaning that up herself."""
# creating temporary directory for testing in current dir
# creating temporary dir for testing in same dir as credentials.conf
cls.testdir = os.path.abspath(
tempfile.mkdtemp(prefix='tmp_%s_'%suffix, dir='.'))
tempfile.mkdtemp(prefix='tmp_%s_'%suffix,
dir=os.path.dirname(cls.cred_file)))
cls.create_config_file()
return cls.testdir