forked from openlp/openlp
Keep unique_identifier of PDF service items.
This commit is contained in:
parent
024ac3d789
commit
76afb204a0
@ -342,6 +342,7 @@ class MessageListener(object):
|
||||
item.iconic_representation = item_cpy.icon
|
||||
item.main = item_cpy.main
|
||||
item.theme = item_cpy.theme
|
||||
item.unique_identifier = item_cpy.unique_identifier
|
||||
# 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.
|
||||
self.handler = None
|
||||
|
@ -98,6 +98,7 @@ def test_start_pdf_presentation(media_mock, media_item):
|
||||
mock_item = MagicMock()
|
||||
mock_item.processor = 'Pdf'
|
||||
mock_item.get_frame_path.return_value = "test.pdf"
|
||||
expected_identifier = mock_item.unique_identifier
|
||||
media_item.generate_slide_data = MagicMock()
|
||||
ml = MessageListener(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
|
||||
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():
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user