当前位置: 首页>>代码示例>>Python>>正文


Python Record.as_marc方法代码示例

本文整理汇总了Python中pymarc.record.Record.as_marc方法的典型用法代码示例。如果您正苦于以下问题:Python Record.as_marc方法的具体用法?Python Record.as_marc怎么用?Python Record.as_marc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pymarc.record.Record的用法示例。


在下文中一共展示了Record.as_marc方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_init_with_leader

# 需要导入模块: from pymarc.record import Record [as 别名]
# 或者: from pymarc.record.Record import as_marc [as 别名]
 def test_init_with_leader(self):
     """
     Test creating a Record with a leader argument.
     """
     record = Record(leader="abcdefghijklmnopqrstuvwx")
     record.add_field(Field(tag="245", indicators=["0", "1"], subfields=["a", "The pragmatic programmer"]))
     transmission_format = record.as_marc()
     transmission_format_leader = transmission_format[0:24]
     self.assertEqual(transmission_format_leader, b"00067fghij2200037rst4500")
开发者ID:cshintov,项目名称:pymarc,代码行数:11,代码来源:record.py

示例2: test_init_with_no_leader

# 需要导入模块: from pymarc.record import Record [as 别名]
# 或者: from pymarc.record.Record import as_marc [as 别名]
 def test_init_with_no_leader(self):
     """
     Test creating a Record object with no leader argument.
     """
     record = Record()
     record.add_field(Field(tag="245", indicators=["0", "1"], subfields=["a", "The pragmatic programmer"]))
     transmission_format = record.as_marc()
     transmission_format_leader = transmission_format[0:24]
     self.assertEqual(transmission_format_leader, b"00067     2200037   4500")
开发者ID:cshintov,项目名称:pymarc,代码行数:11,代码来源:record.py

示例3: test_as_marc_with_explicit_leader

# 需要导入模块: from pymarc.record import Record [as 别名]
# 或者: from pymarc.record.Record import as_marc [as 别名]
 def test_as_marc_with_explicit_leader(self):
     """
     Test setting an explicit leader.
     as_marc() should use the whole leader as set.
     """
     record = Record()
     record.add_field(Field(tag="245", indicators=["0", "1"], subfields=["a", "The pragmatic programmer"]))
     record.leader = "00067     2200037   4500"
     leader_not_touched = record.leader
     transmission_format = record.as_marc()
     leader_touched = record.leader
     self.assertTrue(leader_not_touched == leader_touched)
开发者ID:cshintov,项目名称:pymarc,代码行数:14,代码来源:record.py

示例4: test_as_marc_leader

# 需要导入模块: from pymarc.record import Record [as 别名]
# 或者: from pymarc.record.Record import as_marc [as 别名]
 def test_as_marc_leader(self):
     record = Record()
     record.add_field(
         Field(
             tag = '245', 
             indicators = ['0','1'],
             subfields = ['a', 'The pragmatic programmer']))
     record.leader = '00067     2200037   4500'
     leader_not_touched = record.leader
     transmission_format = record.as_marc()
     leader_touched = record.leader
     self.assertTrue(leader_not_touched==leader_touched)
开发者ID:stancikcom,项目名称:pymarc,代码行数:14,代码来源:record.py

示例5: test_as_marc_consistency

# 需要导入模块: from pymarc.record import Record [as 别名]
# 或者: from pymarc.record.Record import as_marc [as 别名]
 def test_as_marc_consistency(self):
     record = Record()
     leadertype = type(record.leader)
     record.as_marc()
     self.assertEqual(leadertype, type(record.leader))
开发者ID:cshintov,项目名称:pymarc,代码行数:7,代码来源:record.py


注:本文中的pymarc.record.Record.as_marc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。