Keep unique_identifier of PDF service items.

This commit is contained in:
Achim S 2022-02-19 08:20:28 +00:00 committed by Tim Bentley
parent 024ac3d789
commit 76afb204a0
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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():
"""