* pass autoxml tests...
This commit is contained in:
@@ -28,7 +28,7 @@ import gettext
|
|||||||
__trans = gettext.translation('pisi', fallback=True)
|
__trans = gettext.translation('pisi', fallback=True)
|
||||||
_ = __trans.ugettext
|
_ = __trans.ugettext
|
||||||
|
|
||||||
#import xml.dom.minidom as mdom
|
import xml.dom.minidom as mdom
|
||||||
from xml.parsers.expat import ExpatError
|
from xml.parsers.expat import ExpatError
|
||||||
import codecs
|
import codecs
|
||||||
|
|
||||||
|
|||||||
+16
-15
@@ -16,7 +16,8 @@ import types
|
|||||||
|
|
||||||
import pisi
|
import pisi
|
||||||
import pisi.api
|
import pisi.api
|
||||||
from pisi import xmlfile
|
from pisi.xml import xmlfile
|
||||||
|
from pisi.xml import autoxml
|
||||||
import pisi.util as util
|
import pisi.util as util
|
||||||
|
|
||||||
class AutoXmlTestCase(unittest.TestCase):
|
class AutoXmlTestCase(unittest.TestCase):
|
||||||
@@ -24,21 +25,21 @@ class AutoXmlTestCase(unittest.TestCase):
|
|||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|
||||||
class OtherInfo:
|
class OtherInfo:
|
||||||
__metaclass__ = xmlfile.autoxml
|
__metaclass__ = autoxml.autoxml
|
||||||
t_BirthDate = [types.StringType, xmlfile.mandatory]
|
t_BirthDate = [types.StringType, autoxml.mandatory]
|
||||||
t_Interest = [types.StringType, xmlfile.optional]
|
t_Interest = [types.StringType, autoxml.optional]
|
||||||
t_CodesWith = [ [types.StringType], xmlfile.optional, 'CodesWith/Person']
|
t_CodesWith = [ [types.StringType], autoxml.optional, 'CodesWith/Person']
|
||||||
|
|
||||||
class A(xmlfile.XmlFile):
|
class A(xmlfile.XmlFile):
|
||||||
__metaclass__ = xmlfile.autoxml
|
__metaclass__ = autoxml.autoxml
|
||||||
t_Name = [types.StringType, xmlfile.mandatory]
|
t_Name = [types.StringType, autoxml.mandatory]
|
||||||
t_Description = [xmlfile.LocalText, xmlfile.mandatory]
|
t_Description = [autoxml.LocalText, autoxml.mandatory]
|
||||||
t_Number = [types.IntType, xmlfile.optional]
|
t_Number = [types.IntType, autoxml.optional]
|
||||||
t_Email = [types.StringType, xmlfile.optional]
|
t_Email = [types.StringType, autoxml.optional]
|
||||||
a_href = [types.StringType, xmlfile.mandatory]
|
a_href = [types.StringType, autoxml.mandatory]
|
||||||
t_Projects = [ [types.StringType], xmlfile.mandatory, 'Project']
|
t_Projects = [ [types.StringType], autoxml.mandatory, 'Project']
|
||||||
t_OtherInfo = [ OtherInfo, xmlfile.optional ]
|
t_OtherInfo = [ OtherInfo, autoxml.optional ]
|
||||||
s_Comment = [ xmlfile.Text, xmlfile.mandatory]
|
s_Comment = [ autoxml.Text, autoxml.mandatory]
|
||||||
|
|
||||||
self.A = A
|
self.A = A
|
||||||
|
|
||||||
@@ -87,7 +88,7 @@ class AutoXmlTestCase(unittest.TestCase):
|
|||||||
class LocalTextTestCase(unittest.TestCase):
|
class LocalTextTestCase(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
a = xmlfile.LocalText()
|
a = autoxml.LocalText()
|
||||||
a['tr'] = u'Zibidi'
|
a['tr'] = u'Zibidi'
|
||||||
a['en'] = u'ingiliz hiyarlari ne anlar zibididen'
|
a['en'] = u'ingiliz hiyarlari ne anlar zibididen'
|
||||||
self.a = a
|
self.a = a
|
||||||
|
|||||||
Reference in New Issue
Block a user