Author: semor Date: Thu Jul 31 21:07:51 2008 New Revision: 7052 URL: http://svn.gna.org/viewcvs/relax?rev=7052&view=rev Log: Completed the coding for the system tests temporary directory used by external programs. This follows the thread started by Edward d'Auvergne at: https://mail.gna.org/public/relax-devel/2008-07/msg00056.html (message ID: 7f080ed10807310053w4cf118bajab47aad7536db4dc@xxxxxxxxxxxxxx). Modified: 1.3/test_suite/system_tests/dasha.py 1.3/test_suite/system_tests/palmer.py 1.3/test_suite/system_tests/scripts/dasha.py 1.3/test_suite/system_tests/scripts/palmer.py Modified: 1.3/test_suite/system_tests/dasha.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/dasha.py?rev=7052&r1=7051&r2=7052&view=diff ============================================================================== --- 1.3/test_suite/system_tests/dasha.py (original) +++ 1.3/test_suite/system_tests/dasha.py Thu Jul 31 21:07:51 2008 @@ -22,7 +22,6 @@ # Python module imports. import sys -from os import chdir from shutil import rmtree from tempfile import mkdtemp from unittest import TestCase @@ -45,16 +44,18 @@ self.relax.interpreter._Pipe.create('dasha', 'mf') # Create a temporary directory for Dasha outputs. - self.temp_Dasha_dir = mkdtemp() + ds.tmpdir = mkdtemp() def tearDown(self): """Reset the relax data storage object.""" + # Remove the temporary directory. + rmtree(ds.tmpdir) + + + # Reset the relax data storage object. ds.__reset__() - - # Remove the temporary directory created during the execution of the test_dasha() function. - rmtree(self.temp_Dasha_dir) def test_dasha(self): @@ -66,11 +67,5 @@ except: return - # Move to the temporary directory for Dasha outputs. - chdir(self.temp_Dasha_dir) - # Execute the script. self.relax.interpreter.run(script_file=sys.path[-1] + '/test_suite/system_tests/scripts/dasha.py') - - # Move back to the base relax directory. - chdir(sys.path[-1]) 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=7052&r1=7051&r2=7052&view=diff ============================================================================== --- 1.3/test_suite/system_tests/palmer.py (original) +++ 1.3/test_suite/system_tests/palmer.py Thu Jul 31 21:07:51 2008 @@ -22,7 +22,6 @@ # Python module imports. import sys -from os import chdir from shutil import rmtree from tempfile import mkdtemp from unittest import TestCase @@ -45,16 +44,17 @@ self.relax.interpreter._Pipe.create('palmer', 'mf') # Create a temporary directory for ModelFree4 outputs. - self.temp_MF_dir = mkdtemp() + ds.tmpdir = mkdtemp() def tearDown(self): """Reset the relax data storage object.""" + # Remove the temporary directory. + rmtree(ds.tmpdir) + + # Reset the relax data storage object. ds.__reset__() - - # Remove the temporary directory created during the execution of the test_palmer() function. - rmtree(self.temp_MF_dir) def test_palmer(self): @@ -66,11 +66,5 @@ 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/dasha.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/scripts/dasha.py?rev=7052&r1=7051&r2=7052&view=diff ============================================================================== --- 1.3/test_suite/system_tests/scripts/dasha.py (original) +++ 1.3/test_suite/system_tests/scripts/dasha.py Thu Jul 31 21:07:51 2008 @@ -2,6 +2,9 @@ # Python module imports. import sys + +# relax module imports. +from data import Relax_data_store; ds = Relax_data_store() # Set the data pipe names (also the names of preset model-free models). @@ -42,4 +45,4 @@ dasha.extract() # Write the results. - results.write(file='results_dasha', force=True) + results.write(file=ds.tmpdir + '/' + 'results_dasha', force=True) 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=7052&r1=7051&r2=7052&view=diff ============================================================================== --- 1.3/test_suite/system_tests/scripts/palmer.py (original) +++ 1.3/test_suite/system_tests/scripts/palmer.py Thu Jul 31 21:07:51 2008 @@ -2,6 +2,9 @@ # Python module imports. import sys + +# relax module imports. +from data import Relax_data_store; ds = Relax_data_store() # Set the stage of analysis. @@ -44,10 +47,10 @@ model_free.select_model(model=name) # Create the Modelfree4 files. - palmer.create(dir=name, force=True, sims=0) + palmer.create(dir=ds.tmpdir + '/' + name, force=True, sims=0) # Run Modelfree4. - palmer.execute(dir=name, force=True) + palmer.execute(dir=ds.tmpdir + '/' + name, force=True) # Save the program state. state.save('stage1.save', force=True)