mailRe: r7040 - 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 Edward d'Auvergne on July 31, 2008 - 12:46:
Hi,

For this test, I would avoid changing directories.  The original
directory is the directory from which relax was launched, then it
changes to the temporary directory, and finally jumps to the relax
base directory.  However if you pass directory arguments to the
palmer.execute() user function, then this directory switching will be
done anyway (although returning to the original directory rather than
the relax base directory).  Passing the directory argument (or the
directory in front of the file name) to the other palmer user
functions will not cause directory changes, but will access files in
that directory.  So it shouldn't be necessary to switch directories in
the system tests.

Regards,

Edward



On Wed, Jul 30, 2008 at 10:37 PM,  <sebastien.morin.1@xxxxxxxxx> wrote:
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)


_______________________________________________
relax (http://nmr-relax.com)

This is the relax-commits mailing list
relax-commits@xxxxxxx

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits




Related Messages


Powered by MHonArc, Updated Thu Jul 31 20:06:59 2008