本文整理汇总了Python中openlp.core.lib.ServiceItem.missing_frames方法的典型用法代码示例。如果您正苦于以下问题:Python ServiceItem.missing_frames方法的具体用法?Python ServiceItem.missing_frames怎么用?Python ServiceItem.missing_frames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openlp.core.lib.ServiceItem
的用法示例。
在下文中一共展示了ServiceItem.missing_frames方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: service_item_basic_test
# 需要导入模块: from openlp.core.lib import ServiceItem [as 别名]
# 或者: from openlp.core.lib.ServiceItem import missing_frames [as 别名]
def service_item_basic_test(self):
"""
Test the Service Item - basic test
"""
# GIVEN: A new service item
# WHEN: A service item is created (without a plugin)
service_item = ServiceItem(None)
# THEN: We should get back a valid service item
self.assertTrue(service_item.is_valid, 'The new service item should be valid')
self.assertTrue(service_item.missing_frames(), 'There should not be any frames in the service item')
示例2: serviceitem_add_text_test
# 需要导入模块: from openlp.core.lib import ServiceItem [as 别名]
# 或者: from openlp.core.lib.ServiceItem import missing_frames [as 别名]
def serviceitem_add_text_test(self):
"""
Test the Service Item - add text test
"""
# GIVEN: A new service item
service_item = ServiceItem(None)
# WHEN: adding text to a service item
service_item.add_from_text(VERSE)
service_item.raw_footer = FOOTER
# THEN: We should get back a valid service item
assert service_item.is_valid is True, u'The new service item should be valid'
assert service_item.missing_frames() is False, u'check frames loaded '
# WHEN: Render called
assert len(service_item._display_frames) == 0, u'A blank Service Item with no display frames'
service_item.render(True)
# THEN: We should have a page of output.
assert len(service_item._display_frames) == 1, u'A valid rendered Service Item has 1 display frame'
assert service_item.get_rendered_frame(0) == VERSE.split(u'\n')[0], u'A output has rendered correctly.'