(self, xsd_component, data, expected, **kwargs)
| 556 | cases_dir = pathlib.Path(__file__).parent.joinpath('../test_cases') |
| 557 | |
| 558 | def check_decode(self, xsd_component, data, expected, **kwargs): |
| 559 | if isinstance(expected, type) and issubclass(expected, Exception): |
| 560 | self.assertRaises(expected, xsd_component.decode, data, **kwargs) |
| 561 | else: |
| 562 | obj = xsd_component.decode(data, **kwargs) |
| 563 | if isinstance(obj, tuple) and len(obj) == 2 and isinstance(obj[1], list) \ |
| 564 | and isinstance(obj[1][0], Exception): |
| 565 | self.assertEqual(expected, obj[0]) |
| 566 | self.assertTrue(isinstance(obj[0], type(expected))) |
| 567 | else: |
| 568 | self.assertEqual(expected, obj) |
| 569 | self.assertTrue(isinstance(obj, type(expected))) |
| 570 | |
| 571 | @unittest.skipIf(lxml_etree is None, "The lxml library is not available.") |
| 572 | def test_lxml(self): |
no test coverage detected