本文整理汇总了Python中document.documentFields.DocumentFields.getField方法的典型用法代码示例。如果您正苦于以下问题:Python DocumentFields.getField方法的具体用法?Python DocumentFields.getField怎么用?Python DocumentFields.getField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类document.documentFields.DocumentFields
的用法示例。
在下文中一共展示了DocumentFields.getField方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addMultipleFields
# 需要导入模块: from document.documentFields import DocumentFields [as 别名]
# 或者: from document.documentFields.DocumentFields import getField [as 别名]
def addMultipleFields(self):
a = DocumentFields()
a.setField("title", "bc")
a.setField("conf", "machin")
a.setField("author", "martin")
assert (a.getNbFields() == 3)
assert (a.hasField("title"))
assert (a.hasField("conf"))
assert (a.hasField("author"))
assert (a.getField("title") == "bc")
assert (a.getField("conf") == "machin")
assert (a.getField("author") == "martin")
示例2: test_addMultipleFields
# 需要导入模块: from document.documentFields import DocumentFields [as 别名]
# 或者: from document.documentFields.DocumentFields import getField [as 别名]
def test_addMultipleFields(self):
a = DocumentFields()
a.setField("title", "bc")
a.setField("conf", "machin")
a.setField("author", "martin")
self.assertEqual (a.getNbFields(), 3)
self.assertTrue(a.hasField("title"))
self.assertTrue(a.hasField("conf"))
self.assertTrue(a.hasField("author"))
self.assertEqual(a.getField("title"), "bc")
self.assertEqual(a.getField("conf"), "machin")
self.assertEqual(a.getField("author"), "martin")
示例3: test_changeField
# 需要导入模块: from document.documentFields import DocumentFields [as 别名]
# 或者: from document.documentFields.DocumentFields import getField [as 别名]
def test_changeField(self):
a = DocumentFields()
a.setField("title", "bc")
a.setField("title", "Other")
self.assertEqual (a.getNbFields(), 1)
self.assertTrue(a.hasField("title"))
self.assertEqual(a.getField("title"), "Other")
示例4: getEmptyField
# 需要导入模块: from document.documentFields import DocumentFields [as 别名]
# 或者: from document.documentFields.DocumentFields import getField [as 别名]
def getEmptyField(self):
a = DocumentFields()
assert (a.getField("title") == None)
示例5: addField
# 需要导入模块: from document.documentFields import DocumentFields [as 别名]
# 或者: from document.documentFields.DocumentFields import getField [as 别名]
def addField(self):
a = DocumentFields()
a.setField("title", "bc")
assert (a.getNbFields() == 1)
assert (a.hasField("title"))
assert (a.getField("title") == "bc")
示例6: test_getEmptyField
# 需要导入模块: from document.documentFields import DocumentFields [as 别名]
# 或者: from document.documentFields.DocumentFields import getField [as 别名]
def test_getEmptyField(self):
a = DocumentFields()
self.assertIsNone(a.getField("title"), None)