1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
# -*- coding: utf-8 -*-
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
from pyxb.exceptions_ import *
import unittest
import pyxb.binding.datatypes as xsd
class Test_IDREF (unittest.TestCase):
def testValid (self):
valid = [ 'schema', '_Underscore', '_With.Dot', 'With-Hyphen' ]
for f in valid:
self.assertEqual(f, xsd.IDREF(f))
def testInvalid (self):
invalid = [ '.DotFirst', 'With Spaces', 'With:Colon',
'With?Illegal', '??LeadingIllegal', 'TrailingIllegal??',
' LeadingSpace', 'TrailingSpace ']
for f in invalid:
self.assertRaises(SimpleTypeValueError, xsd.IDREF, f)
if __name__ == '__main__':
unittest.main()
|