Ejemplo n.º 1
0
 def testSchemaSupport (self):
     instance = trac26.eTranslateCard(trac26.eConcCardCymru('un'),
                                      trac26.eConcCardEnglish('one'),
                                      xs.int(1))
     self.assertTrue(instance.validateBinding())
     instance = trac26.CreateFromDocument(self.Good_xmlt)
     self.assertEqual(self.Good_xmld, instance.toxml('utf-8', root_only=True))
     instance = trac26.eTranslateCard(trac26.eConcCardCymru('un'))
     instance.cardinal = 1
     instance.eConcCardEnglish = 'one'
     self.assertTrue(instance.validateBinding())
Ejemplo n.º 2
0
 def testSchemaSupport(self):
     instance = trac26.eTranslateCard(trac26.eConcCardCymru('un'),
                                      trac26.eConcCardEnglish('one'),
                                      xs.int(1))
     self.assertTrue(instance.validateBinding())
     instance = trac26.CreateFromDocument(self.Good_xmlt)
     self.assertEqual(self.Good_xmld, instance.toxml('utf-8',
                                                     root_only=True))
     instance = trac26.eTranslateCard(trac26.eConcCardCymru('un'))
     instance.cardinal = 1
     instance.eConcCardEnglish = 'one'
     self.assertTrue(instance.validateBinding())
Ejemplo n.º 3
0
 def testException(self):
     instance = trac26.eTranslateCard(trac26.eConcCardCymru('un'))
     instance.cardinal = 1
     with self.assertRaises(pyxb.IncompleteElementContentError) as cm:
         instance.validateBinding()
     e = cm.exception
     self.assertFalse(e.fac_configuration.isAccepting())
     self.assertEqual(1, len(e.symbols))
     self.assertEqual(1, len(e.symbol_set))
     (ed, syms) = e.symbol_set.iteritems().next()
     self.assertEqual(1, len(syms))
     self.assertEqual(instance.cardinal, syms[0])
     self.assertEqual(e.details(), self.Bad_details)
Ejemplo n.º 4
0
 def testException (self):
     instance = trac26.eTranslateCard(trac26.eConcCardCymru('un'))
     instance.cardinal = 1
     with self.assertRaises(pyxb.IncompleteElementContentError) as cm:
         instance.validateBinding()
     e = cm.exception
     self.assertFalse(e.fac_configuration.isAccepting())
     self.assertEqual(1, len(e.symbols))
     self.assertEqual(1, len(e.symbol_set))
     (ed, syms) = e.symbol_set.iteritems().next()
     self.assertEqual(1, len(syms))
     self.assertEqual(instance.cardinal, syms[0])
     self.assertEqual(e.details(), self.Bad_details)
Ejemplo n.º 5
0
 def testException(self):
     instance = trac26.eTranslateCard(trac26.eConcCardCymru('un'))
     instance.cardinal = 1
     with self.assertRaises(pyxb.IncompleteElementContentError) as cm:
         instance.validateBinding()
     e = cm.exception
     self.assertFalse(e.fac_configuration.isAccepting())
     self.assertEqual(1, len(e.symbols))
     self.assertEqual(1, len(e.symbol_set))
     (ed, syms) = next(six.iteritems(e.symbol_set))
     self.assertEqual(1, len(syms))
     self.assertEqual(instance.cardinal, syms[0])
     expect = self.Bad_details
     if pyxb.XMLStyle_minidom == pyxb._XMLStyle:
         expect = self.Bad_details_noloc
     self.assertEqual(e.details(), expect)
Ejemplo n.º 6
0
 def testException (self):
     instance = trac26.eTranslateCard(trac26.eConcCardCymru('un'))
     instance.cardinal = 1
     with self.assertRaises(pyxb.IncompleteElementContentError) as cm:
         instance.validateBinding()
     e = cm.exception
     self.assertFalse(e.fac_configuration.isAccepting())
     self.assertEqual(1, len(e.symbols))
     self.assertEqual(1, len(e.symbol_set))
     (ed, syms) = next(six.iteritems(e.symbol_set))
     self.assertEqual(1, len(syms))
     self.assertEqual(instance.cardinal, syms[0])
     expect = self.Bad_details
     if pyxb.XMLStyle_minidom == pyxb._XMLStyle:
         expect = self.Bad_details_noloc
     self.assertEqual(e.details(), expect)