forked from openlp/openlp
Fix tests
This commit is contained in:
parent
7ee8d8c576
commit
9f7725573d
@ -320,6 +320,7 @@ class MediaController(object):
|
|||||||
display.hasAudio = False
|
display.hasAudio = False
|
||||||
for player in self.mediaPlayers.values():
|
for player in self.mediaPlayers.values():
|
||||||
if player.isActive:
|
if player.isActive:
|
||||||
|
print "z"
|
||||||
player.setup(display)
|
player.setup(display)
|
||||||
|
|
||||||
def set_controls_visible(self, controller, value):
|
def set_controls_visible(self, controller, value):
|
||||||
|
@ -103,12 +103,15 @@ class VlcPlayer(MediaPlayer):
|
|||||||
self.original_name = u'VLC'
|
self.original_name = u'VLC'
|
||||||
self.display_name = u'&VLC'
|
self.display_name = u'&VLC'
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
|
print "p",parent
|
||||||
self.canFolder = True
|
self.canFolder = True
|
||||||
self.audio_extensions_list = AUDIO_EXT
|
self.audio_extensions_list = AUDIO_EXT
|
||||||
self.video_extensions_list = VIDEO_EXT
|
self.video_extensions_list = VIDEO_EXT
|
||||||
|
|
||||||
def setup(self, display):
|
def setup(self, display):
|
||||||
|
print "D",display
|
||||||
display.vlcWidget = QtGui.QFrame(display)
|
display.vlcWidget = QtGui.QFrame(display)
|
||||||
|
display.vlcWidget.setFrameStyle(QtGui.QFrame.NoFrame)
|
||||||
# creating a basic vlc instance
|
# creating a basic vlc instance
|
||||||
command_line_options = u'--no-video-title-show'
|
command_line_options = u'--no-video-title-show'
|
||||||
if not display.hasAudio:
|
if not display.hasAudio:
|
||||||
|
@ -22,12 +22,10 @@ class TestServiceItem(TestCase):
|
|||||||
"""
|
"""
|
||||||
#GIVEN: A new service item
|
#GIVEN: A new service item
|
||||||
|
|
||||||
# WHEN:A service item is created (without a plugin)
|
#WHEN:A service item is created (without a plugin)
|
||||||
service_item = ServiceItem(None)
|
service_item = ServiceItem(None)
|
||||||
|
|
||||||
# THEN: We should get back a valid service item
|
#THEN: We should get back a valid service item
|
||||||
print service_item
|
|
||||||
print dir(service_item)
|
|
||||||
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'No frames loaded yet'
|
assert service_item.missing_frames() is True, u'No frames loaded yet'
|
||||||
|
|
||||||
@ -38,11 +36,11 @@ class TestServiceItem(TestCase):
|
|||||||
#GIVEN: A new service item
|
#GIVEN: A new service item
|
||||||
service_item = ServiceItem(None)
|
service_item = ServiceItem(None)
|
||||||
|
|
||||||
# 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 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 False, u'check frames loaded '
|
assert service_item.missing_frames() is False, u'check frames loaded '
|
||||||
|
|
||||||
@ -69,10 +67,10 @@ class TestServiceItem(TestCase):
|
|||||||
mocked_renderer = MagicMock()
|
mocked_renderer = MagicMock()
|
||||||
service_item.renderer = mocked_renderer
|
service_item.renderer = mocked_renderer
|
||||||
|
|
||||||
# WHEN: adding image to a service item
|
#WHEN: adding image to a service item
|
||||||
service_item.add_from_image(u'resources/church.jpg', u'Image Title')
|
service_item.add_from_image(u'resources/church.jpg', u'Image Title')
|
||||||
|
|
||||||
# THEN: We should get back a valid service item
|
#THEN: We should get back a valid service item
|
||||||
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 len(service_item._display_frames) is 0, u'A blank Service Item'
|
assert len(service_item._display_frames) is 0, u'A blank Service Item'
|
||||||
|
|
||||||
@ -80,7 +78,7 @@ class TestServiceItem(TestCase):
|
|||||||
assert len(service_item._raw_frames) is 1, u'A valid rendered Service Item has display frames'
|
assert len(service_item._raw_frames) is 1, u'A valid rendered Service Item has display frames'
|
||||||
assert service_item.get_rendered_frame(0) == u'resources/church.jpg'
|
assert service_item.get_rendered_frame(0) == u'resources/church.jpg'
|
||||||
|
|
||||||
# WHEN: adding a second image to a service item
|
#WHEN: adding a second image to a service item
|
||||||
service_item.add_from_image(u'resources/church.jpg', u'Image1 Title')
|
service_item.add_from_image(u'resources/church.jpg', u'Image1 Title')
|
||||||
|
|
||||||
#THEN: We should should have an increased page of output.
|
#THEN: We should should have an increased page of output.
|
||||||
@ -124,10 +122,10 @@ class TestServiceItem(TestCase):
|
|||||||
mocked_renderer = MagicMock()
|
mocked_renderer = MagicMock()
|
||||||
service_item.renderer = mocked_renderer
|
service_item.renderer = mocked_renderer
|
||||||
|
|
||||||
# WHEN: adding image to a service item
|
#WHEN: adding image to a service item
|
||||||
service_item.add_from_command(u'resources', u'church.jpg', u'resources/church.jpg')
|
service_item.add_from_command(u'resources', u'church.jpg', u'resources/church.jpg')
|
||||||
|
|
||||||
# THEN: We should get back a valid service item
|
#THEN: We should get back a valid service item
|
||||||
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 len(service_item._display_frames) is 0, u'A blank Service Item'
|
assert len(service_item._display_frames) is 0, u'A blank Service Item'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user