mailr9497 - in /1.3/test_suite/system_tests: results.py state.py


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

Header


Content

Posted by edward on September 10, 2009 - 17:38:
Author: bugman
Date: Thu Sep 10 17:38:20 2009
New Revision: 9497

URL: http://svn.gna.org/viewcvs/relax?rev=9497&view=rev
Log:
Shifted the test_write_read_pipes() system test to the 'state' test module.

The program state is now being saved as the results file is for just one data 
pipe.


Modified:
    1.3/test_suite/system_tests/results.py
    1.3/test_suite/system_tests/state.py

Modified: 1.3/test_suite/system_tests/results.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/results.py?rev=9497&r1=9496&r2=9497&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/results.py (original)
+++ 1.3/test_suite/system_tests/results.py Thu Sep 10 17:38:20 2009
@@ -28,7 +28,6 @@
 
 # relax module imports.
 from data import Relax_data_store; ds = Relax_data_store()
-from generic_fns.pipes import VALID_TYPES
 
 
 class Results(TestCase):
@@ -69,33 +68,3 @@
 
         # Write the results.
         self.relax.interpreter._Results.write(file=self.tmpfile, dir=None)
-
-
-    def test_write_read_pipes(self):
-        """Test the writing out, and re-reading of data pipes from the 
results file."""
-
-        # Remove the data pipe created by self.setUp().
-        ds.__reset__()
-
-        # Create a few data pipes.
-        for i in range(len(VALID_TYPES)):
-            self.relax.interpreter._Pipe.create('test' + repr(i), 
VALID_TYPES[i])
-
-        # Write the results.
-        self.relax.interpreter._Results.write(file=self.tmpfile, dir=None)
-
-        # Reset the relax data storage object.
-        ds.__reset__()
-
-        # Re-read the results.
-        self.relax.interpreter._Results.read(file=self.tmpfile)
-
-        # Test the pipes.
-        for i in range(len(VALID_TYPES)):
-            # Name.
-            name = 'test' + repr(i)
-            self.assert_(haskey(ds, name))
-
-            # Type.
-            pipe = get_pipe(name)
-            self.assertEqual(pipe.name, VALID_TYPES[i])

Modified: 1.3/test_suite/system_tests/state.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/state.py?rev=9497&r1=9496&r2=9497&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/state.py (original)
+++ 1.3/test_suite/system_tests/state.py Thu Sep 10 17:38:20 2009
@@ -28,6 +28,7 @@
 
 # relax module imports.
 from data import Relax_data_store; ds = Relax_data_store()
+from generic_fns.pipes import VALID_TYPES
 
 
 class State(TestCase):
@@ -70,3 +71,36 @@
 
         # Load the state.
         self.relax.interpreter._State.load(self.tmpfile)
+
+
+    def test_write_read_pipes(self):
+        """Test the writing out, and re-reading of data pipes from the state 
file."""
+
+        # Create a data pipe.
+        self.relax.interpreter._Pipe.create('test', 'relax_fit')
+
+        # Remove the data pipe.
+        ds.__reset__()
+
+        # Create a few data pipes.
+        for i in range(len(VALID_TYPES)):
+            self.relax.interpreter._Pipe.create('test' + repr(i), 
VALID_TYPES[i])
+
+        # Write the results.
+        self.relax.interpreter._State.save(self.tmpfile)
+
+        # Reset the relax data storage object.
+        ds.__reset__()
+
+        # Re-read the results.
+        self.relax.interpreter._State.load(self.tmpfile)
+
+        # Test the pipes.
+        for i in range(len(VALID_TYPES)):
+            # Name.
+            name = 'test' + repr(i)
+            self.assert_(haskey(ds, name))
+
+            # Type.
+            pipe = get_pipe(name)
+            self.assertEqual(pipe.name, VALID_TYPES[i])




Related Messages


Powered by MHonArc, Updated Thu Sep 10 18:20:02 2009