commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnue] r8469 - trunk/gnue-common/src/utils


From: reinhard
Subject: [gnue] r8469 - trunk/gnue-common/src/utils
Date: Thu, 18 May 2006 07:29:03 -0500 (CDT)

Author: reinhard
Date: 2006-05-18 07:29:03 -0500 (Thu, 18 May 2006)
New Revision: 8469

Modified:
   trunk/gnue-common/src/utils/tree.py
Log:
Make separate functions for test code.


Modified: trunk/gnue-common/src/utils/tree.py
===================================================================
--- trunk/gnue-common/src/utils/tree.py 2006-05-18 12:16:06 UTC (rev 8468)
+++ trunk/gnue-common/src/utils/tree.py 2006-05-18 12:29:03 UTC (rev 8469)
@@ -680,11 +680,11 @@
 # Self test code
 # =============================================================================
 
-if __name__ == '__main__':
+# -----------------------------------------------------------------------------
+# Node class
+# -----------------------------------------------------------------------------
 
-    # -------------------------------------------------------------------------
-    # Node class
-    # -------------------------------------------------------------------------
+def test_node_class():
 
     # Descendant of Node used in test code
     class TestNode(Node):
@@ -730,10 +730,12 @@
     print monty_python, "has now a parent of", monty_python.parent
 
 
-    # -------------------------------------------------------------------------
-    # NamedNode class
-    # -------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
+# NamedNode class
+# -----------------------------------------------------------------------------
 
+def test_named_node_class():
+
     # Descendants of NamedNode used in test code
     class TextNode(NamedNode):
         def __init__(self, parent, text):
@@ -845,3 +847,13 @@
         root.get_node_dict('woman')
     except NodeDictNotAvailableError, error:
         print "Correctly got an exception:", error
+
+
+# -----------------------------------------------------------------------------
+# Run tests
+# -----------------------------------------------------------------------------
+
+if __name__ == '__main__':
+
+    test_node_class()
+    test_named_node_class()





reply via email to

[Prev in Thread] Current Thread [Next in Thread]