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

Fred L. Drake, Jr. fred@zope.com
Thu, 12 Dec 2002 00:04:17 -0500


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

Modified Files:
      Tag: zconfig-schema-devel-branch
	test_schema.py 
Log Message:
Test that the datatype conversion for the whole schema is applied.


=== Packages/ZConfig/tests/test_schema.py 1.1.2.6 => 1.1.2.7 ===
--- Packages/ZConfig/tests/test_schema.py:1.1.2.6	Wed Dec 11 22:13:25 2002
+++ Packages/ZConfig/tests/test_schema.py	Thu Dec 12 00:04:17 2002
@@ -98,7 +98,7 @@
 
     def test_app_sectiontype(self):
         schema = self.load_schema_text(
-            "<schema>"
+            "<schema type='%s.appsection'>"
             "  <section names='sect' type='%s.appsection'"
             "           sectiontype='foo'>"
             "    <key name='sample' type='integer'>"
@@ -106,17 +106,19 @@
             "      </key>"
             "    </section>"
             "</schema>"
-            % __name__)
+            % (__name__, __name__))
         conf = self.load_config_text(schema,
                                      "<foo sect>\n"
                                      "  sample 42\n"
                                      "</foo>")
-        self.assertEqual(len(conf), 1)
-        o1 = conf[0]
+        self.assert_(isinstance(conf, MySection))
+        self.assertEqual(conf.length, 1)
+        o1 = conf.conf[0]
         self.assert_(isinstance(o1, MySection))
         self.assertEqual(o1.length, 1)
         self.assertEqual(o1.conf.sample, 42)
-        self.assert_(isinstance(conf.sect, MySection))
+        o2 = conf.conf.sect
+        self.assert_(o1 is o2)
 
     def test_multivalued_keys(self):
         schema = self.load_schema_text(