forked from openlp/openlp
More tests
This commit is contained in:
parent
e8b578c8a2
commit
96f302b1c2
@ -37,16 +37,17 @@ class TestServiceItem(TestCase):
|
|||||||
with patch(u'openlp.core.lib.Plugin') as mocked_plugin:
|
with patch(u'openlp.core.lib.Plugin') as mocked_plugin:
|
||||||
#GIVEN: A new service item
|
#GIVEN: A new service item
|
||||||
service_item = ServiceItem(mocked_plugin)
|
service_item = ServiceItem(mocked_plugin)
|
||||||
#true_boolean = True
|
|
||||||
# WHEN: adding text to a service item
|
# WHEN: adding text to a service item
|
||||||
service_item.add_from_text(VERSE)
|
service_item.add_from_text(VERSE)
|
||||||
service_item.raw_footer = FOOTER
|
service_item.raw_footer = FOOTER
|
||||||
# THEN: We should get back a valid service item
|
# THEN: We should get back a valid service item
|
||||||
#assert isinstance(true_result, bool), u'The result should be a boolean'
|
|
||||||
assert service_item.is_valid is True, u'A valid Service Item'
|
assert service_item.is_valid is True, u'A valid Service Item'
|
||||||
assert service_item.missing_frames() is True, u'frames loaded '
|
assert service_item.missing_frames() is True, u'frames loaded '
|
||||||
|
|
||||||
#GIVEN: A service item with text
|
#GIVEN: A service item with text
|
||||||
|
service_item.renderer = MagicMock().Renderer.format_slide.return_value = VERSE
|
||||||
#WHEN: Render called
|
#WHEN: Render called
|
||||||
service_item.render(TRUE)
|
assert len(service_item._display_frames) is 0, u'A blank Service Item'
|
||||||
|
service_item.render(True)
|
||||||
#THEN: ?
|
#THEN: ?
|
||||||
|
assert len(service_item._display_frames) > 0, u'A valid rendered Service Item has display frames'
|
Loading…
Reference in New Issue
Block a user