(self)
| 429 | self.assertTrue(col_data.is_valid()) |
| 430 | |
| 431 | def test_missing_child(self): |
| 432 | col_data = self.col_schema.decode(self.col_xml_filename) |
| 433 | self.assertTrue(col_data.is_valid()) |
| 434 | |
| 435 | title = col_data[0].pop(1) |
| 436 | with self.assertRaises(XMLSchemaValidationError) as ec: |
| 437 | col_data.validate() |
| 438 | self.assertIn("Unexpected child with tag 'year' at position 2", str(ec.exception)) |
| 439 | self.assertFalse(col_data.is_valid()) |
| 440 | errors = list(col_data.iter_errors()) |
| 441 | self.assertEqual(len(errors), 1) |
| 442 | self.assertIn("Unexpected child with tag 'year' at position 2", str(errors[0])) |
| 443 | |
| 444 | col_data[0].insert(1, title) |
| 445 | self.assertTrue(col_data.is_valid()) |
| 446 | |
| 447 | def test_max_depth_validation(self): |
| 448 | col_data = self.col_schema.decode(self.col_xml_filename) |
nothing calls this directly
no test coverage detected