mailr3720 - in /branches/N_state_model: ./ data/__init__.py test_suite/unit_tests/generic_fns/test_state.py


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

Header


Content

Posted by edward on November 20, 2007 - 19:15:
Author: bugman
Date: Tue Nov 20 19:14:59 2007
New Revision: 3720

URL: http://svn.gna.org/viewcvs/relax?rev=3720&view=rev
Log:
Merged revisions 3715-3719 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3

........
  r3715 | bugman | 2007-11-20 18:49:27 +0100 (Tue, 20 Nov 2007) | 3 lines
  
  A temporary fix to the broken pickling of the relax data storage singleton.
........
  r3716 | bugman | 2007-11-20 19:09:37 +0100 (Tue, 20 Nov 2007) | 3 lines
  
  Added a unit test for the generic_fns.state.load() function.
........
  r3717 | bugman | 2007-11-20 19:11:18 +0100 (Tue, 20 Nov 2007) | 3 lines
  
  Fix for the generic_fns.state.load() function.
........
  r3718 | bugman | 2007-11-20 19:13:42 +0100 (Tue, 20 Nov 2007) | 3 lines
  
  Improved the docstring of the generic_fns.state.load() unit test.
........
  r3719 | bugman | 2007-11-20 19:14:17 +0100 (Tue, 20 Nov 2007) | 3 lines
  
  Improved the docstring of the generic_fns.state.save() unit test.
........

Modified:
    branches/N_state_model/   (props changed)
    branches/N_state_model/data/__init__.py
    branches/N_state_model/test_suite/unit_tests/generic_fns/test_state.py

Propchange: branches/N_state_model/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Nov 20 19:14:59 2007
@@ -1,1 +1,1 @@
-/1.3:1-3692,3695,3697-3713
+/1.3:1-3692,3695,3697-3713,3715-3719

Modified: branches/N_state_model/data/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/N_state_model/data/__init__.py?rev=3720&r1=3719&r2=3720&view=diff
==============================================================================
--- branches/N_state_model/data/__init__.py (original)
+++ branches/N_state_model/data/__init__.py Tue Nov 20 19:14:59 2007
@@ -34,7 +34,7 @@
             'main' ]
 
 
-class Data(dict):
+class Data2(dict):
     """The relax data storage object."""
 
     # The current data pipe.
@@ -127,4 +127,4 @@
 
 # Rebind the name Data with an instance to prevent accidental creation
 # of multiple instances of the Data class
-Data = Data()
+Data = Data2()

Modified: 
branches/N_state_model/test_suite/unit_tests/generic_fns/test_state.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/N_state_model/test_suite/unit_tests/generic_fns/test_state.py?rev=3720&r1=3719&r2=3720&view=diff
==============================================================================
--- branches/N_state_model/test_suite/unit_tests/generic_fns/test_state.py 
(original)
+++ branches/N_state_model/test_suite/unit_tests/generic_fns/test_state.py 
Tue Nov 20 19:14:59 2007
@@ -56,8 +56,36 @@
         remove('test.bz2')
 
 
-    def test_save(self):
-        """Test the normal operation of the generic_fns.state.save() 
function."""
+    def test_load(self):
+        """The unpickling and restoration of the relax data storage 
singleton.
+
+        This tests the normal operation of the generic_fns.state.load() 
function.
+        """
 
         # Save the state.
         state.save('test')
+
+        # Reset the relax data store.
+        relax_data_store.__reset__()
+
+        # Test the contents of the empty singleton.
+        self.assertEqual(relax_data_store.keys(), [])
+        self.assertEqual(relax_data_store.current_pipe, None)
+
+        # Load the state.
+        state.load('test')
+
+        # Test the contents of the restored singleton.
+        self.assertEqual(relax_data_store.keys(), ['orig'])
+        self.assertEqual(relax_data_store.current_pipe, 'orig')
+        self.assertEqual(relax_data_store['orig'].x, 1)
+
+
+    def test_save(self):
+        """The pickling and saving of the relax data storage singleton.
+
+        This tests the normal operation of the generic_fns.state.save() 
function.
+        """
+
+        # Save the state.
+        state.save('test')




Related Messages


Powered by MHonArc, Updated Tue Nov 20 19:40:06 2007