(self)
| 133 | self.assertEqual(data_element.xsd_version, self.col_schema.XSD_VERSION) |
| 134 | |
| 135 | def test_xsd_element_binding(self): |
| 136 | xsd_element = self.col_schema.elements['person'] |
| 137 | data_element = DataElement(tag=self.col_xml_root.tag, xsd_element=xsd_element) |
| 138 | data_element.xsd_element = xsd_element |
| 139 | |
| 140 | with self.assertRaises(TypeError) as ec: |
| 141 | DataElement(tag=xsd_element.name, xsd_element=self.col_schema) |
| 142 | self.assertIn("invalid type for attribute 'xsd_element'", str(ec.exception)) |
| 143 | |
| 144 | with self.assertRaises(ValueError) as ec: |
| 145 | data_element.xsd_element = self.col_schema.elements['collection'] |
| 146 | self.assertIn('the instance is already bound to another XSD element', str(ec.exception)) |
| 147 | |
| 148 | def test_xsd_type_binding(self): |
| 149 | xsd_type = self.col_schema.elements['person'].type |
nothing calls this directly
no test coverage detected