[Zodb-checkins] CVS: Packages/SFTPGateway/src/ZConfig/tests - test_schema.py:1.20

Fred L. Drake, Jr. fred at zope.com
Sun Dec 28 21:43:06 EST 2003


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

Modified Files:
	test_schema.py 
Log Message:
add test that a derived section type uses the base keytype


=== Packages/SFTPGateway/src/ZConfig/tests/test_schema.py 1.19 => 1.20 ===
--- Packages/SFTPGateway/src/ZConfig/tests/test_schema.py:1.19	Fri Oct  3 16:37:09 2003
+++ Packages/SFTPGateway/src/ZConfig/tests/test_schema.py	Sun Dec 28 21:43:03 2003
@@ -665,6 +665,26 @@
                           </schema>
                           """)
 
+    def test_sectiontype_derived_keytype(self):
+        schema = self.load_schema_text("""\
+            <schema>
+              <sectiontype name='sect' keytype='identifier'/>
+              <sectiontype name='derived' extends='sect'>
+                <key name='foo' attribute='foo'/>
+                <key name='Foo' attribute='Foo'/>
+              </sectiontype>
+              <section name='foo' type='derived'/>
+            </schema>
+            """)
+        conf = self.load_config_text(schema, """\
+            <derived foo>
+              foo bar
+              Foo BAR
+            </derived>
+            """)
+        self.assertEqual(conf.foo.foo, "bar")
+        self.assertEqual(conf.foo.Foo, "BAR")
+
     def test_schema_keytype(self):
         schema = self.load_schema_text("""\
             <schema keytype='ipaddr-or-hostname'>




More information about the Zodb-checkins mailing list