forked from openlp/openlp
Merge branch 'AchimStuy-master-patch-36540' into 'master'
Keep unique_identifier of PDF service items. See merge request openlp/openlp!419
This commit is contained in:
commit
b94bc0021e
@ -342,6 +342,7 @@ class MessageListener(object):
|
|||||||
item.iconic_representation = item_cpy.icon
|
item.iconic_representation = item_cpy.icon
|
||||||
item.main = item_cpy.main
|
item.main = item_cpy.main
|
||||||
item.theme = item_cpy.theme
|
item.theme = item_cpy.theme
|
||||||
|
item.unique_identifier = item_cpy.unique_identifier
|
||||||
# When presenting PDF/XPS/OXPS, we are using the image presentation code,
|
# When presenting PDF/XPS/OXPS, we are using the image presentation code,
|
||||||
# so handler & processor is set to None, and we skip adding the handler.
|
# so handler & processor is set to None, and we skip adding the handler.
|
||||||
self.handler = None
|
self.handler = None
|
||||||
|
@ -98,6 +98,7 @@ def test_start_pdf_presentation(media_mock, media_item):
|
|||||||
mock_item = MagicMock()
|
mock_item = MagicMock()
|
||||||
mock_item.processor = 'Pdf'
|
mock_item.processor = 'Pdf'
|
||||||
mock_item.get_frame_path.return_value = "test.pdf"
|
mock_item.get_frame_path.return_value = "test.pdf"
|
||||||
|
expected_identifier = mock_item.unique_identifier
|
||||||
media_item.generate_slide_data = MagicMock()
|
media_item.generate_slide_data = MagicMock()
|
||||||
ml = MessageListener(media_item)
|
ml = MessageListener(media_item)
|
||||||
ml.media_item = media_item
|
ml.media_item = media_item
|
||||||
@ -109,6 +110,9 @@ def test_start_pdf_presentation(media_mock, media_item):
|
|||||||
# THEN: The handler should be set to None
|
# THEN: The handler should be set to None
|
||||||
assert ml.handler is None, 'The handler should be None'
|
assert ml.handler is None, 'The handler should be None'
|
||||||
|
|
||||||
|
# THEN: unique_identifier should still be the same.
|
||||||
|
assert mock_item.unique_identifier == expected_identifier, 'unique_identifier should not be changed'
|
||||||
|
|
||||||
|
|
||||||
def test_add_handler_failure():
|
def test_add_handler_failure():
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user