mailr3716 - /1.3/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:09:
Author: bugman
Date: Tue Nov 20 19:09:37 2007
New Revision: 3716

URL: http://svn.gna.org/viewcvs/relax?rev=3716&view=rev
Log:
Added a unit test for the generic_fns.state.load() function.


Modified:
    1.3/test_suite/unit_tests/generic_fns/test_state.py

Modified: 1.3/test_suite/unit_tests/generic_fns/test_state.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/generic_fns/test_state.py?rev=3716&r1=3715&r2=3716&view=diff
==============================================================================
--- 1.3/test_suite/unit_tests/generic_fns/test_state.py (original)
+++ 1.3/test_suite/unit_tests/generic_fns/test_state.py Tue Nov 20 19:09:37 
2007
@@ -56,6 +56,29 @@
         remove('test.bz2')
 
 
+    def test_load(self):
+        """Test 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)
+        self.assertRaises(AttributeError, relax_data_store['orig'].x)
+
+        # 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):
         """Test the normal operation of the generic_fns.state.save() 
function."""
 




Related Messages


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