예제 #1
0
 def test_fm_2(self):
     record = MarcRecord().add(100, '', SubField('a', '100A'), SubField('b', '100B'))
     record.add(200, '', SubField('b', '200B'), SubField('c', '200C'))
     self.assertEqual('100A', record.fm(100, 'a'))
     self.assertEqual('100B', record.fm(100, 'b'))
     self.assertIsNone(record.fm(100, 'c'))
     self.assertIsNone(record.fm(200, 'a'))
     self.assertEqual('200B', record.fm(200, 'b'))
     self.assertEqual('200C', record.fm(200, 'c'))
예제 #2
0
 def test_fm_1(self):
     record = MarcRecord().add(100, 'Field 100').add(200, 'Field 200')
     self.assertEqual('Field 100', record.fm(100))
     self.assertEqual('Field 200', record.fm(200))
     self.assertIsNone(record.fm(300))