* test'i biraz gelistir
This commit is contained in:
@@ -14,7 +14,9 @@
|
||||
<BirthDate>18071976</BirthDate>
|
||||
<Interest>AI</Interest>
|
||||
<CodesWith>
|
||||
<Person>Baris</Person>
|
||||
<Person>Gurer</Person>
|
||||
<Person>Caglar</Person>
|
||||
<Person>Meren</Person>
|
||||
</CodesWith>
|
||||
</OtherInfo>
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user