[CMF-checkins] CVS: CMF/CMFSetup/tests - test_workflow.py:1.18

Tres Seaver tseaver at zope.com
Thu Jun 24 14:25:12 EDT 2004


Update of /cvs-repository/CMF/CMFSetup/tests
In directory cvs.zope.org:/tmp/cvs-serv2595/tests

Modified Files:
	test_workflow.py 
Log Message:


  - Preserve non-string values for variable defaults.


=== CMF/CMFSetup/tests/test_workflow.py 1.17 => 1.18 ===
--- CMF/CMFSetup/tests/test_workflow.py:1.17	Thu Jun 24 13:59:05 2004
+++ CMF/CMFSetup/tests/test_workflow.py	Thu Jun 24 14:24:41 2004
@@ -1051,6 +1051,24 @@
 
             default = variable[ 'default' ]
             self.assertEqual( default[ 'value' ], expected[ 1 ] )
+
+            exp_type = 'n/a'
+
+            if expected[ 1 ]:
+                exp_value = expected[ 1 ]
+
+                if isinstance( exp_value, bool ):
+                    exp_type = 'bool'
+                elif isinstance( exp_value, int ):
+                    exp_type = 'int'
+                elif isinstance( exp_value, float ):
+                    exp_type = 'float'
+                elif isinstance( exp_value, basestring ):
+                    exp_type = 'string'
+                else:
+                    exp_type = 'XXX'
+
+            self.assertEqual( default[ 'type' ], exp_type )
             self.assertEqual( default[ 'expression' ], expected[ 2 ] )
 
             self.assertEqual( variable[ 'for_catalog' ], expected[ 3 ] )
@@ -1695,7 +1713,7 @@
     update_always="True">
    Killed by
    <default>
-    <value>n/a</value>
+    <value type="string">n/a</value>
    </default>
    <guard>
     <guard-role>Hangman</guard-role>



More information about the CMF-checkins mailing list