Exemplo n.º 1
0
 def test_load_from_file_with_classname(self):
     """Test using shortcut to initialize named XmlObject class from string"""
     
     class TestObject(xmlmap.XmlObject):
         pass
     
     obj = xmlmap.load_xmlobject_from_file(self.FILE.name, TestObject)
     self.assert_(isinstance(obj, TestObject))
Exemplo n.º 2
0
 def test_load_from_file_with_validation(self):
     # has doctype, but not valid
     self.assertRaises(Exception, xmlmap.load_xmlobject_from_file, self.INVALID.name, validate=True)
     # no doctype
     self.assertRaises(Exception, xmlmap.load_xmlobject_from_file, self.FILE.name, validate=True)
     # doctype, valid
     obj = xmlmap.load_xmlobject_from_file(self.VALID.name, validate=True)
     self.assert_(isinstance(obj, xmlmap.XmlObject))
Exemplo n.º 3
0
 def test_load_from_file(self):
     """Test using shortcut to initialize XmlObject from a file"""
     obj = xmlmap.load_xmlobject_from_file(self.FILE.name)
     self.assert_(isinstance(obj, xmlmap.XmlObject))