def test_del_field(self):
        record = create_record(self.xml)
        record.add_subfield('101__b', 'not title')

        del record['100__']

        expected_record = BibRecord()
        expected_record.add_subfield('101__b', 'not title')

        self.assertEqual(record, expected_record)
 def test_add_subfield(self):
     xml = """<record>
         <datafield tag="100" ind1=" " ind2=" ">
             <subfield code="a">our title</subfield>
         </datafield>
     </record>"""
     expected_record = create_record(xml)
     record = BibRecord()
     record.add_subfield('100__a', 'our title')
     self.assertEqual(record, expected_record)
    def test_del_field(self):
        record = create_record(self.xml)
        record.add_subfield('101__b', 'not title')

        del record['100__']

        expected_record = BibRecord()
        expected_record.add_subfield('101__b', 'not title')

        self.assertEqual(record, expected_record)
Example #4
0
 def test_add_subfield(self):
     xml = """<record>
         <datafield tag="100" ind1=" " ind2=" ">
             <subfield code="a">our title</subfield>
         </datafield>
     </record>"""
     expected_record = create_record(xml)
     record = BibRecord()
     record.add_subfield('100__a', 'our title')
     self.assertEqual(record, expected_record)
    def test_simple(self):
        record = BibRecord()
        record.add_subfield('100__a', 'Test Journal Name')
        record.add_subfield('773__p', 'Test Journal Name')
        record.add_subfield('999C5s', 'Test Journal Name,100,10')
        converted_record = convert_journals(self.kb, record)

        expected_record = BibRecord()
        expected_record.add_subfield('100__a', 'Test Journal Name')
        expected_record.add_subfield('773__p', 'Converted')
        expected_record.add_subfield('999C5s', 'Converted,100,10')

        self.assertEqual(expected_record, converted_record)
Example #6
0
    def test_simple(self):
        record = BibRecord()
        record.add_subfield('100__a', 'Test Journal Name')
        record.add_subfield('773__p', 'Test Journal Name')
        record.add_subfield('999C5s', 'Test Journal Name,100,10')
        converted_record = convert_journals(self.kb, record)

        expected_record = BibRecord()
        expected_record.add_subfield('100__a', 'Test Journal Name')
        expected_record.add_subfield('773__p', 'Converted')
        expected_record.add_subfield('999C5s', 'Converted,100,10')

        self.assertEqual(expected_record, converted_record)
 def test_add_subfield(self):
     expected_record = create_record(self.xml)
     record = BibRecord()
     record.add_subfield('100__a', 'our title')
     self.assertEqual(record, expected_record)
 def test_add_subfield(self):
     expected_record = create_record(self.xml)
     record = BibRecord()
     record.add_subfield('100__a', 'our title')
     self.assertEqual(record, expected_record)