def test_empty_collection(self):
     """bibfield - empty collection"""
     blob_error0 = """<collection></collection>"""
     rec = create_record(blob_error0, master_format='marc', schema='xml')
     self.assertTrue(rec.is_empty())
     records = create_records(blob_error0)
     self.assertEqual(len(records), 0)
 def test_empty_collection(self):
     """bibfield - empty collection"""
     blob_error0 = """<collection></collection>"""
     rec = create_record(blob_error0, master_format='marc', schema='xml')
     self.assertTrue(rec.is_empty())
     records = create_records(blob_error0)
     self.assertEqual(len(records), 0)
 def setUp(self):
     """Initialize stuff"""
     f = open(CFG_TMPDIR + '/demobibdata.xml', 'r')
     blob = f.read()
     f.close()
     self.recs = [
         rec
         for rec in create_records(blob, master_format='marc', schema='xml')
     ]
 def test_create_record_with_collection_tag(self):
     """ bibfield - create_record() for single record in collection"""
     blob = """
     <collection>
     <record>
     <controlfield tag="001">33</controlfield>
     <datafield tag="041" ind1=" " ind2=" ">
     <subfield code="a">eng</subfield>
     </datafield>
     </record>
     </collection>
     """
     record = create_record(blob, master_format='marc', schema='xml')
     record1 = create_records(blob, master_format='marc', schema='xml')[0]
     self.assertEqual(record1, record)
 def test_create_record_with_collection_tag(self):
     """ bibfield - create_record() for single record in collection"""
     blob = """
     <collection>
     <record>
     <controlfield tag="001">33</controlfield>
     <datafield tag="041" ind1=" " ind2=" ">
     <subfield code="a">eng</subfield>
     </datafield>
     </record>
     </collection>
     """
     record = create_record(blob, master_format='marc', schema='xml')
     record1 = create_records(blob, master_format='marc', schema='xml')[0]
     self.assertEqual(record1, record)
 def setUp(self):
     """Initialize stuff"""
     f = open(CFG_TMPDIR + '/demobibdata.xml', 'r')
     blob = f.read()
     f.close()
     self.recs = [rec for rec in create_records(blob, master_format='marc', schema='xml')]