mailr7040 - in /1.3/test_suite/system_tests: palmer.py scripts/palmer.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by sebastien . morin . 1 on July 30, 2008 - 22:57:
Author: semor
Date: Wed Jul 30 22:37:09 2008
New Revision: 7040

URL: http://svn.gna.org/viewcvs/relax?rev=7040&view=rev
Log:
Changed the temporary directory to the system's default location using 
'tempfile.mkdtemp'.

This is in response to a post of Edward d'Auvergne at:
https://mail.gna.org/public/relax-devel/2008-07/msg00048.html (message ID:
7f080ed10807291507x5b6aab2fv820a6fc219fc7e2b@xxxxxxxxxxxxxx).


Modified:
    1.3/test_suite/system_tests/palmer.py
    1.3/test_suite/system_tests/scripts/palmer.py

Modified: 1.3/test_suite/system_tests/palmer.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/palmer.py?rev=7040&r1=7039&r2=7040&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/palmer.py (original)
+++ 1.3/test_suite/system_tests/palmer.py Wed Jul 30 22:37:09 2008
@@ -22,12 +22,14 @@
 
 # Python module imports.
 import sys
+from os import chdir
 from shutil import rmtree
+from tempfile import mkdtemp
 from unittest import TestCase
 
 # relax module imports.
 from data import Relax_data_store; ds = Relax_data_store()
-from relax_io import mkdir_nofail, test_binary
+from relax_io import test_binary
 
 
 class Palmer(TestCase):
@@ -43,7 +45,7 @@
         self.relax.interpreter._Pipe.create('palmer', 'mf')
 
         # Create a temporary directory for ModelFree4 outputs.
-        mkdir_nofail(sys.path[-1] + 
'/test_suite/system_tests/data/temp_palmer')
+        self.temp_MF_dir = mkdtemp()
 
 
     def tearDown(self):
@@ -52,7 +54,7 @@
         ds.__reset__()
 
         # Remove the temporary directory created during the execution of the 
test_palmer() function.
-        rmtree(sys.path[-1] + '/test_suite/system_tests/data/temp_palmer/')
+        rmtree(self.temp_MF_dir)
 
 
     def test_palmer(self):
@@ -64,5 +66,11 @@
         except:
             return
 
+        # Move to the temporary directory for ModelFree4 outputs.
+        chdir(self.temp_MF_dir)
+
         # Execute the script.
         self.relax.interpreter.run(script_file=sys.path[-1] + 
'/test_suite/system_tests/scripts/palmer.py')
+
+        # Move back to the base relax directory.
+        chdir(sys.path[-1])

Modified: 1.3/test_suite/system_tests/scripts/palmer.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/scripts/palmer.py?rev=7040&r1=7039&r2=7040&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/scripts/palmer.py (original)
+++ 1.3/test_suite/system_tests/scripts/palmer.py Wed Jul 30 22:37:09 2008
@@ -1,7 +1,6 @@
 # Script for model-free analysis using the program 'Modelfree4'.
 
 # Python module imports.
-from os import chdir
 import sys
 
 
@@ -121,9 +120,6 @@
 # Set the run name (also the name of a preset model-free model).
 runs = ['m1', 'm2', 'm3']
 
-# Move to the temporary directory.
-chdir(sys.path[-1] + '/test_suite/system_tests/data/temp_palmer')
-
 # Run the stages.
 exec_stage_1(runs)
 exec_stage_2(runs)




Related Messages


Powered by MHonArc, Updated Wed Jul 30 23:00:31 2008