(self)
| 162 | self.assertIn('the instance is already bound to another XSD type', str(ec.exception)) |
| 163 | |
| 164 | def test_mutable_mapping_api(self): |
| 165 | data_element = DataElement('root') |
| 166 | |
| 167 | self.assertEqual(len(data_element), 0) |
| 168 | with self.assertRaises(AssertionError): |
| 169 | data_element.append(1) |
| 170 | |
| 171 | data_element.append(DataElement('elem1')) |
| 172 | self.assertEqual(len(data_element), 1) |
| 173 | self.assertEqual(data_element[0].tag, 'elem1') |
| 174 | |
| 175 | data_element.insert(0, DataElement('elem0')) |
| 176 | self.assertEqual(len(data_element), 2) |
| 177 | self.assertEqual(data_element[0].tag, 'elem0') |
| 178 | self.assertEqual(data_element[1].tag, 'elem1') |
| 179 | |
| 180 | data_element[0] = DataElement('elem2') |
| 181 | self.assertEqual(data_element[0].tag, 'elem2') |
| 182 | |
| 183 | del data_element[0] |
| 184 | self.assertEqual(len(data_element), 1) |
| 185 | self.assertEqual(data_element[0].tag, 'elem1') |
| 186 | |
| 187 | def test_xpath_api(self): |
| 188 | col_data = self.col_schema.decode(self.col_xml_filename) |
nothing calls this directly
no test coverage detected