コード例 #1
0
 def test_load_data_structure_error(self, mock_xsltproc, mock_xml_parse,
                                    mock_etree_parse, mock_relax):
     mock_validate = mock.Mock()
     mock_validate.validate = mock.Mock(return_value=True)
     mock_relax.return_value = mock_validate
     mock_xml_parse.side_effect = KiwiDataStructureError(
         'DataStructureError')
     self.description_from_file.load()
コード例 #2
0
ファイル: xml_description.py プロジェクト: rabueker/kiwi
 def _parse(self):
     try:
         parse = xml_parse.parse(self.description, True)
         parse.description_dir = self.description_origin and os.path.dirname(
             self.description_origin)
         parse.derived_description_dir = self.derived_from
         return parse
     except Exception as issue:
         raise KiwiDataStructureError(issue)
コード例 #3
0
ファイル: xml_description.py プロジェクト: phoenixflare/kiwi
 def _parse(self):
     try:
         parse = xml_parse.parse(self.description_xslt_processed.name, True)
         parse.description_dir = self.description and os.path.dirname(
             self.description)
         parse.derived_description_dir = self.derived_from
         return parse
     except Exception as e:
         raise KiwiDataStructureError('%s: %s' %
                                      (type(e).__name__, format(e)))
コード例 #4
0
 def test_load_data_structure_error(self, mock_xml_parse, mock_etree_parse,
                                    mock_relax, mock_schematron):
     mock_rng_validate = mock.Mock()
     mock_rng_validate.validate = mock.Mock(return_value=True)
     mock_sch_validate = mock.Mock()
     mock_sch_validate.validate = mock.Mock(return_value=True)
     mock_relax.return_value = mock_rng_validate
     mock_schematron.return_value = mock_sch_validate
     mock_xml_parse.side_effect = KiwiDataStructureError(
         'DataStructureError')
     with raises(KiwiDataStructureError):
         self.description_from_file.load()