[cig-commits] r6964 - short/3D/PyLith/trunk/unittests/pytests/topology

brad at geodynamics.org brad at geodynamics.org
Thu May 24 20:32:59 PDT 2007


Author: brad
Date: 2007-05-24 20:32:59 -0700 (Thu, 24 May 2007)
New Revision: 6964

Modified:
   short/3D/PyLith/trunk/unittests/pytests/topology/TestFieldsManager.py
Log:
Added Python unit tests for history features of FieldsManager.

Modified: short/3D/PyLith/trunk/unittests/pytests/topology/TestFieldsManager.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/topology/TestFieldsManager.py	2007-05-25 03:26:57 UTC (rev 6963)
+++ short/3D/PyLith/trunk/unittests/pytests/topology/TestFieldsManager.py	2007-05-25 03:32:59 UTC (rev 6964)
@@ -179,6 +179,76 @@
     return
 
 
+  def test_createHistory(self):
+    """
+    Test createHistory().
+
+    WARNING: This is not a rigorous test of setConstraintSizes() because we
+    don't verify the results.
+    """
+    mesh = self._initialize()
+    from pylith.topology.FieldsManager import FieldsManager
+    manager = FieldsManager(mesh)
+    
+    fields = ["field A", "field B", "field C", "field D"]
+    for field in fields:
+      manager.addReal(field)
+
+    historyFields = fields[0:2]
+    manager.createHistory(historyFields)
+
+    # We should really add something here to check to make sure things
+    # actually initialized correctly.
+    return
+
+
+  def test_shiftHistory(self):
+    """
+    Test createHistory().
+
+    WARNING: This is not a rigorous test of setConstraintSizes() because we
+    don't verify the results.
+    """
+    mesh = self._initialize()
+    from pylith.topology.FieldsManager import FieldsManager
+    manager = FieldsManager(mesh)
+    
+    fields = ["field A", "field B"]
+    for field in fields:
+      manager.addReal(field)
+
+    manager.createHistory(fields)
+    manager.shiftHistory()
+
+    # We should really add something here to check to make sure things
+    # actually initialized correctly.
+    return
+
+
+  def test_getHistoryItem(self):
+    """
+    Test createHistory().
+
+    WARNING: This is not a rigorous test of setConstraintSizes() because we
+    don't verify the results.
+    """
+    mesh = self._initialize()
+    from pylith.topology.FieldsManager import FieldsManager
+    manager = FieldsManager(mesh)
+    
+    fields = ["field A", "field B", "field C"]
+    for field in fields:
+      manager.addReal(field)
+
+    manager.createHistory(fields)
+    for i in [0, 2, 1]:
+      field = manager.getHistoryItem(i)
+
+    # We should really add something here to check to make sure things
+    # actually initialized correctly.
+    return
+
+
   # PRIVATE METHODS ////////////////////////////////////////////////////
 
   def _initialize(self):



More information about the cig-commits mailing list