def test_non_oai_conversion(self): """Test conversion of non-OAI-PMH input MARCXML.""" from harvestingkit.bibrecord import BibRecordPackage from harvestingkit.inspire_cds_package.from_inspire import Inspire2CDS bibrecs = BibRecordPackage(self.inspire_demo_data_path) bibrecs.parse() xml = Inspire2CDS.convert_all(bibrecs.get_records()) self.assertEqual(xml.count("</record>"), 3) self.assertEqual(xml.count('<controlfield tag="003">SzGeCERN</controlfield>'), 3)
def test_multiple_conversions(self): """Test conversion of multiple records.""" from harvestingkit.bibrecord import BibRecordPackage from harvestingkit.inspire_cds_package.from_inspire import Inspire2CDS bibrecs = BibRecordPackage(self.inspire_demo_data_path_oai) bibrecs.parse() xml = Inspire2CDS.convert_all(bibrecs.get_records()) self.assertEqual(xml.count("</record>"), 5) self.assertEqual(xml.count('<controlfield tag="003">SzGeCERN</controlfield>'), 5)