[Zope3-checkins] CVS: Packages/ZConfig/tests - test_schema.py:1.1.2.16

Fred L. Drake, Jr. fred@zope.com
Fri, 13 Dec 2002 12:28:12 -0500


Update of /cvs-repository/Packages/ZConfig/tests
In directory cvs.zope.org:/tmp/cvs-serv17266/tests

Modified Files:
      Tag: zconfig-schema-devel-branch
	test_schema.py 
Log Message:
Change the datatype converters to not be special objects, but any callable
that takes one argument.


=== Packages/ZConfig/tests/test_schema.py 1.1.2.15 => 1.1.2.16 ===
--- Packages/ZConfig/tests/test_schema.py:1.1.2.15	Fri Dec 13 12:12:59 2002
+++ Packages/ZConfig/tests/test_schema.py	Fri Dec 13 12:28:11 2002
@@ -23,13 +23,11 @@
 from ZConfig.tests.test_config import CONFIG_BASE
 
 
-class uppercase:
-    def convert(self, value):
-        return str(value).upper()
-
-class appsection:
-    def convert(self, value):
-        return MySection(value)
+def uppercase(value):
+    return str(value).upper()
+
+def appsection(value):
+    return MySection(value)
 
 class MySection:
     def __init__(self, value):
@@ -99,7 +97,7 @@
     def test_app_sectiontype(self):
         schema = self.load_schema_text(
             "<schema datatype='%s.appsection' prefix='%s'>"
-            "  <sectiontype type='foo' datatype='.appsection'>"
+            "  <sectiontype type='foo' datatype='.MySection'>"
             "    <key name='sample' datatype='integer'>"
             "      <default>345</default>"
             "      </key>"