diff --git a/tests/a.xml b/tests/a.xml index b4cfc2cc..4ca73e79 100644 --- a/tests/a.xml +++ b/tests/a.xml @@ -14,7 +14,9 @@ 18071976 AI + Baris Gurer + Caglar Meren diff --git a/tests/xmlfiletests.py b/tests/xmlfiletests.py index 37662bd1..189c9724 100644 --- a/tests/xmlfiletests.py +++ b/tests/xmlfiletests.py @@ -29,7 +29,8 @@ class XmlFileTestCase(unittest.TestCase): class OtherInfo: __metaclass__ = xmlfile.autoxml t_BirthDate = [types.StringType, xmlfile.mandatory] - t_Interest = [types.StringType, xmlfile.mandatory] + t_Interest = [types.StringType, xmlfile.optional] + t_CodesWith = [ [types.StringType], xmlfile.optional, 'CodesWith/Person'] class A: __metaclass__ = xmlfile.autoxml @@ -39,6 +40,7 @@ class XmlFileTestCase(unittest.TestCase): a_href = [types.StringType, xmlfile.mandatory] t_Projects = [ [types.StringType], xmlfile.mandatory, 'Projects/Project'] t_OtherInfo = [ OtherInfo, xmlfile.optional ] + a = A() self.assertEqual(a.href, None) dom = mdom.parse('tests/a.xml')