本文整理汇总了Python中pymarc.record.Record.addedentries方法的典型用法代码示例。如果您正苦于以下问题:Python Record.addedentries方法的具体用法?Python Record.addedentries怎么用?Python Record.addedentries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymarc.record.Record
的用法示例。
在下文中一共展示了Record.addedentries方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_added_entries
# 需要导入模块: from pymarc.record import Record [as 别名]
# 或者: from pymarc.record.Record import addedentries [as 别名]
def test_added_entries(self):
record = Record()
ae1 = "=730 0\\$aTosefta.$lEnglish.$f1977."
ae2 = "=700 10$aLe Peu, Pepe."
aelist = [ae1, ae2]
self.assertEquals(record.addedentries(), [])
record.add_field(Field("730", [0, " "], subfields=["a", "Tosefta.", "l", "English.", "f", "1977."]))
record.add_field(Field("700", [1, 0], subfields=["a", "Le Peu, Pepe."]))
record.add_field(Field("245", [0, 0], subfields=["a", "Le Peu's Tosefa."]))
self.assertEquals(len(record.addedentries()), 2)
self.assertEquals(record.addedentries()[0].__str__(), ae1)
self.assertEquals(record.addedentries()[1].__str__(), ae2)
raelist = [rae.__str__() for rae in record.addedentries()]
self.assertEquals(aelist, raelist)
示例2: test_added_entries
# 需要导入模块: from pymarc.record import Record [as 别名]
# 或者: from pymarc.record.Record import addedentries [as 别名]
def test_added_entries(self):
record = Record()
ae1 = '=730 0\\$aTosefta.$lEnglish.$f1977.'
ae2 = '=700 10$aLe Peu, Pepe.'
aelist = [ae1, ae2]
self.assertEqual(record.addedentries(), [])
record.add_field(Field('730', [0, ' '],
subfields=['a', "Tosefta.", 'l', "English.", 'f', "1977."]))
record.add_field(Field('700', [1, 0],
subfields=['a', "Le Peu, Pepe."]))
record.add_field(Field('245', [0, 0],
subfields=['a', "Le Peu's Tosefa."]))
self.assertEqual(len(record.addedentries()), 2)
self.assertEqual(record.addedentries()[0].__str__(), ae1)
self.assertEqual(record.addedentries()[1].__str__(), ae2)
raelist = [rae.__str__() for rae in record.addedentries()]
self.assertEqual(aelist, raelist)