* test'i biraz gelistir
This commit is contained in:
@@ -14,7 +14,9 @@
|
|||||||
<BirthDate>18071976</BirthDate>
|
<BirthDate>18071976</BirthDate>
|
||||||
<Interest>AI</Interest>
|
<Interest>AI</Interest>
|
||||||
<CodesWith>
|
<CodesWith>
|
||||||
|
<Person>Baris</Person>
|
||||||
<Person>Gurer</Person>
|
<Person>Gurer</Person>
|
||||||
|
<Person>Caglar</Person>
|
||||||
<Person>Meren</Person>
|
<Person>Meren</Person>
|
||||||
</CodesWith>
|
</CodesWith>
|
||||||
</OtherInfo>
|
</OtherInfo>
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ class XmlFileTestCase(unittest.TestCase):
|
|||||||
class OtherInfo:
|
class OtherInfo:
|
||||||
__metaclass__ = xmlfile.autoxml
|
__metaclass__ = xmlfile.autoxml
|
||||||
t_BirthDate = [types.StringType, xmlfile.mandatory]
|
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:
|
class A:
|
||||||
__metaclass__ = xmlfile.autoxml
|
__metaclass__ = xmlfile.autoxml
|
||||||
@@ -39,6 +40,7 @@ class XmlFileTestCase(unittest.TestCase):
|
|||||||
a_href = [types.StringType, xmlfile.mandatory]
|
a_href = [types.StringType, xmlfile.mandatory]
|
||||||
t_Projects = [ [types.StringType], xmlfile.mandatory, 'Projects/Project']
|
t_Projects = [ [types.StringType], xmlfile.mandatory, 'Projects/Project']
|
||||||
t_OtherInfo = [ OtherInfo, xmlfile.optional ]
|
t_OtherInfo = [ OtherInfo, xmlfile.optional ]
|
||||||
|
|
||||||
a = A()
|
a = A()
|
||||||
self.assertEqual(a.href, None)
|
self.assertEqual(a.href, None)
|
||||||
dom = mdom.parse('tests/a.xml')
|
dom = mdom.parse('tests/a.xml')
|
||||||
|
|||||||
Reference in New Issue
Block a user