[Zodb-checkins] CVS: Packages/ZConfig/tests - test_schema.py:1.1.2.13

Fred L. Drake, Jr. fred@zope.com
Fri, 13 Dec 2002 10:45:22 -0500


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

Modified Files:
      Tag: zconfig-schema-devel-branch
	test_schema.py 
Log Message:
Test loading of a config that relies on a section group.


=== Packages/ZConfig/tests/test_schema.py 1.1.2.12 => 1.1.2.13 ===
--- Packages/ZConfig/tests/test_schema.py:1.1.2.12	Fri Dec 13 10:01:12 2002
+++ Packages/ZConfig/tests/test_schema.py	Fri Dec 13 10:45:21 2002
@@ -230,6 +230,17 @@
         self.assert_(t.gettype("t2") is t2)
         self.assertRaises(ZConfig.ConfigurationError, t.gettype, "group")
         self.assert_(t1 is not t2)
+        # try loading a config that relies on this schema
+        conf = self.load_config_text(schema,
+                                     "<t1/>\n"
+                                     "<t1>\n </t1>\n"
+                                     "<t2/>\n"
+                                     "<t2>\n </t2>\n")
+        self.assertEqual(len(conf.g), 4)
+        self.assert_(conf.g[0].__type__ is t1)
+        self.assert_(conf.g[1].__type__ is t1)
+        self.assert_(conf.g[2].__type__ is t2)
+        self.assert_(conf.g[3].__type__ is t2)
 
     # utilities