From: TinfoilSubmarine <TinfoilSubmarine@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: OpenLP: update to 3.0.0
Date: Mon, 09 Jan 2023 14:36:49 +0100 [thread overview]
Message-ID: <20230109133649.0cqsxDxbfJB-ZgxCeOKGxyNOcdZwwDNtXNvh_81LBo0@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-41526@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 40049 bytes --]
New comment by TinfoilSubmarine on void-packages repository
https://github.com/void-linux/void-packages/pull/41526#issuecomment-1375637426
Comment:
Did you run the tests (`./xbps-src pkg OpenLP -Q`)? They are failing locally for me...
```
=> OpenLP-3.0.0_1: running do_check ...
============================= test session starts ==============================
platform linux -- Python 3.11.1, pytest-7.1.3, pluggy-1.0.0
PyQt5 5.15.7 -- Qt runtime 5.15.7 -- Qt compiled 5.15.5
rootdir: /builddir/OpenLP-3.0.0, configfile: setup.cfg
plugins: qt-3.3.0
collected 2265 items
tests/openlp_core/test_app.py ............... [ 0%]
tests/openlp_core/test_server.py ..... [ 0%]
tests/openlp_core/test_state.py ............... [ 1%]
tests/openlp_core/test_threading.py ......... [ 1%]
tests/openlp_core/test_version.py ........... [ 2%]
tests/openlp_core/api/test_deploy.py ........... [ 2%]
tests/openlp_core/api/test_main.py . [ 2%]
tests/openlp_core/api/test_tab.py .................. [ 3%]
tests/openlp_core/api/test_websockets.py .......... [ 4%]
tests/openlp_core/api/endpoint/test_controller.py .... [ 4%]
tests/openlp_core/api/http_server/test_http.py .. [ 4%]
tests/openlp_core/api/http_server/test_init.py ....... [ 4%]
tests/openlp_core/api/v2/test_controller.py ............................ [ 6%]
.... [ 6%]
tests/openlp_core/api/v2/test_core.py .............. [ 6%]
tests/openlp_core/api/v2/test_plugins.py ........ [ 7%]
tests/openlp_core/api/v2/test_service.py ........ [ 7%]
tests/openlp_core/common/test_actions.py .......... [ 7%]
tests/openlp_core/common/test_applocation.py ............. [ 8%]
tests/openlp_core/common/test_db.py .. [ 8%]
tests/openlp_core/common/test_handlers.py . [ 8%]
tests/openlp_core/common/test_httputils.py .................. [ 9%]
tests/openlp_core/common/test_i18n.py ............ [ 9%]
tests/openlp_core/common/test_init.py ..FF.............................. [ 11%]
.................. [ 12%]
tests/openlp_core/common/test_json.py .................. [ 13%]
tests/openlp_core/common/test_mixins.py .... [ 13%]
tests/openlp_core/common/test_network_interfaces.py ...... [ 13%]
tests/openlp_core/common/test_path.py ................. [ 14%]
tests/openlp_core/common/test_platform.py ..... [ 14%]
tests/openlp_core/common/test_registry.py ...... [ 14%]
tests/openlp_core/common/test_settings.py ...................... [ 15%]
tests/openlp_core/common/test_utils.py ....... [ 16%]
tests/openlp_core/display/test_render.py .......... [ 16%]
tests/openlp_core/display/test_screens.py ........................ [ 17%]
tests/openlp_core/display/test_window.py ............................... [ 18%]
.......... [ 19%]
tests/openlp_core/lib/test_db.py ........ [ 19%]
tests/openlp_core/lib/test_exceptions.py . [ 19%]
tests/openlp_core/lib/test_formattingtags.py .. [ 19%]
tests/openlp_core/lib/test_lib.py ...................................... [ 21%]
........... [ 21%]
tests/openlp_core/lib/test_mediamanageritem.py ...... [ 22%]
tests/openlp_core/lib/test_pluginmanager.py ........................s [ 23%]
tests/openlp_core/lib/test_serviceitem.py .........................FFF [ 24%]
tests/openlp_core/lib/test_theme.py ................ [ 25%]
tests/openlp_core/lib/test_ui.py ................. [ 26%]
tests/openlp_core/pages/test_alignment.py .......................... [ 27%]
tests/openlp_core/pages/test_areaposition.py ..................... [ 28%]
tests/openlp_core/pages/test_background.py ............................. [ 29%]
.... [ 29%]
tests/openlp_core/pages/test_fontselection.py .......................... [ 30%]
................ [ 31%]
tests/openlp_core/pages/test_gridlayoutpage.py .... [ 31%]
tests/openlp_core/projectors/test_projector_commands_01.py .......... [ 32%]
tests/openlp_core/projectors/test_projector_commands_02.py ............. [ 32%]
..... [ 32%]
tests/openlp_core/projectors/test_projector_constants.py ... [ 32%]
tests/openlp_core/projectors/test_projector_db.py ...................... [ 33%]
...... [ 34%]
tests/openlp_core/projectors/test_projector_pjlink_base_01.py .......... [ 34%]
........ [ 35%]
tests/openlp_core/projectors/test_projector_pjlink_udp.py ......... [ 35%]
tests/openlp_core/projectors/test_projector_sourceform.py ... [ 35%]
tests/openlp_core/projectors/commands/test_avmt.py ......... [ 35%]
tests/openlp_core/projectors/commands/test_clss.py ....... [ 36%]
tests/openlp_core/projectors/commands/test_misc_commands.py .... [ 36%]
tests/openlp_core/projectors/commands/test_pjlink.py ........... [ 36%]
tests/openlp_core/projectors/commands/test_routing.py ........ [ 37%]
tests/openlp_core/projectors/commands/test_sver.py .... [ 37%]
tests/openlp_core/projectors/db/test_get_projector.py .............. [ 38%]
tests/openlp_core/projectors/editform/test_accept_me.py ................ [ 38%]
. [ 38%]
tests/openlp_core/projectors/editform/test_misc_editform.py ..... [ 39%]
tests/openlp_core/projectors/manager/test_boostrap.py .... [ 39%]
tests/openlp_core/projectors/manager/test_misc_manager.py ... [ 39%]
tests/openlp_core/projectors/manager/test_toolbar_triggers-01.py ....... [ 39%]
........... [ 40%]
tests/openlp_core/projectors/manager/test_toolbar_triggers-basic.py .... [ 40%]
[ 40%]
tests/openlp_core/projectors/manager/test_udp.py ..... [ 40%]
tests/openlp_core/projectors/pjlink/test_check_login.py ...... [ 40%]
tests/openlp_core/projectors/pjlink/test_get_data.py ............ [ 41%]
tests/openlp_core/projectors/pjlink/test_misc_pjlink.py ............ [ 41%]
tests/openlp_core/projectors/pjlink/test_reset_information.py . [ 41%]
tests/openlp_core/projectors/pjlink/test_send_command.py ............... [ 42%]
. [ 42%]
tests/openlp_core/projectors/ui/test_tab.py ....... [ 42%]
tests/openlp_core/ui/test_aboutform.py ... [ 43%]
tests/openlp_core/ui/test_advancedtab.py . [ 43%]
tests/openlp_core/ui/test_confirmationform.py ... [ 43%]
tests/openlp_core/ui/test_exceptionform.py .. [ 43%]
tests/openlp_core/ui/test_filerenamedialog.py ... [ 43%]
tests/openlp_core/ui/test_first_time.py . [ 43%]
tests/openlp_core/ui/test_firsttimeform.py ...................... [ 44%]
tests/openlp_core/ui/test_formattingtagscontroller.py .... [ 44%]
tests/openlp_core/ui/test_formattingtagsform.py .. [ 44%]
tests/openlp_core/ui/test_generaltab.py .... [ 44%]
tests/openlp_core/ui/test_icons.py . [ 44%]
tests/openlp_core/ui/test_init.py .. [ 45%]
tests/openlp_core/ui/test_library.py .... [ 45%]
tests/openlp_core/ui/test_mainwindow.py ................................ [ 46%]
....... [ 46%]
tests/openlp_core/ui/test_serviceitemeditform.py ............... [ 47%]
tests/openlp_core/ui/test_servicemanager.py ............................ [ 48%]
.................................................... [ 51%]
tests/openlp_core/ui/test_servicenotedialog.py . [ 51%]
tests/openlp_core/ui/test_servicetab.py . [ 51%]
tests/openlp_core/ui/test_settings_form.py .... [ 51%]
tests/openlp_core/ui/test_settingsform.py ....... [ 51%]
tests/openlp_core/ui/test_shortcutlistdialog.py .. [ 51%]
tests/openlp_core/ui/test_shortcutlistform.py .......... [ 52%]
tests/openlp_core/ui/test_slidecontroller.py ........................... [ 53%]
................................... [ 54%]
tests/openlp_core/ui/test_splashscreen.py . [ 55%]
tests/openlp_core/ui/test_starttimedialog.py .. [ 55%]
tests/openlp_core/ui/test_style.py ss.......s....s...... [ 56%]
tests/openlp_core/ui/test_themeform.py ........................sssss. [ 57%]
tests/openlp_core/ui/test_thememanager.py ...................... [ 58%]
tests/openlp_core/ui/test_themeprogressform.py ...... [ 58%]
tests/openlp_core/ui/test_themetab.py .. [ 58%]
tests/openlp_core/ui/media/test_media.py ... [ 58%]
tests/openlp_core/ui/media/test_mediacontroller.py ..................... [ 59%]
......... [ 60%]
tests/openlp_core/ui/media/test_remote.py .........s [ 60%]
tests/openlp_core/ui/media/test_vlcplayer.py ........................... [ 61%]
.... [ 61%]
tests/openlp_core/widgets/test_buttons.py ....... [ 62%]
tests/openlp_core/widgets/test_dialogs.py ............. [ 62%]
tests/openlp_core/widgets/test_edits.py ..................... [ 63%]
tests/openlp_core/widgets/test_views.py .......................... [ 64%]
tests/openlp_core/widgets/test_widgets.py ........................... [ 66%]
tests/openlp_plugins/alerts/test_manager.py ... [ 66%]
tests/openlp_plugins/alerts/test_plugin.py ..... [ 66%]
tests/openlp_plugins/alerts/forms/test_alertform.py . [ 66%]
tests/openlp_plugins/bibles/test_bibleimport.py ........................ [ 67%]
...... [ 67%]
tests/openlp_plugins/bibles/test_bibleserver.py sss [ 67%]
tests/openlp_plugins/bibles/test_biblestab.py .. [ 68%]
tests/openlp_plugins/bibles/test_csvimport.py ................. [ 68%]
tests/openlp_plugins/bibles/test_lib.py ........ [ 69%]
tests/openlp_plugins/bibles/test_lib_http.py ........... [ 69%]
tests/openlp_plugins/bibles/test_lib_manager.py .... [ 69%]
tests/openlp_plugins/bibles/test_lib_parse_reference.py ............ [ 70%]
tests/openlp_plugins/bibles/test_manager.py . [ 70%]
tests/openlp_plugins/bibles/test_mediaitem.py .......................... [ 71%]
.......................................................... [ 74%]
tests/openlp_plugins/bibles/test_opensongimport.py .................... [ 74%]
tests/openlp_plugins/bibles/test_osisimport.py ..................... [ 75%]
tests/openlp_plugins/bibles/test_plugin.py . [ 75%]
tests/openlp_plugins/bibles/test_swordimport.py ss [ 76%]
tests/openlp_plugins/bibles/test_upgrade.py ..... [ 76%]
tests/openlp_plugins/bibles/test_versereferencelist.py ..... [ 76%]
tests/openlp_plugins/bibles/test_wordprojectimport.py ........ [ 76%]
tests/openlp_plugins/bibles/test_zefaniaimport.py ... [ 76%]
tests/openlp_plugins/bibles/forms/test_bibleimportform.py sss [ 77%]
tests/openlp_plugins/bibles/forms/test_editbibleform.py . [ 77%]
tests/openlp_plugins/custom/test_mediaitem.py ... [ 77%]
tests/openlp_plugins/custom/test_plugin.py . [ 77%]
tests/openlp_plugins/custom/forms/test_customform.py ....... [ 77%]
tests/openlp_plugins/custom/forms/test_customslideform.py .. [ 77%]
tests/openlp_plugins/images/test_imagetab.py ... [ 77%]
tests/openlp_plugins/images/test_mediaitem.py ................. [ 78%]
tests/openlp_plugins/images/test_plugin.py . [ 78%]
tests/openlp_plugins/images/test_upgrade.py . [ 78%]
tests/openlp_plugins/images/forms/test_choosegroupform.py .... [ 78%]
tests/openlp_plugins/media/test_mediaitem.py ....... [ 79%]
tests/openlp_plugins/media/test_mediaplugin.py .. [ 79%]
tests/openlp_plugins/media/test_plugin.py . [ 79%]
tests/openlp_plugins/media/forms/test_mediaclipselectorform.py .... [ 79%]
tests/openlp_plugins/media/forms/test_streamselectorform.py ........ [ 79%]
tests/openlp_plugins/planningcenter/test_planningcenterplugin.py ....... [ 80%]
[ 80%]
tests/openlp_plugins/planningcenter/forms/test_selectplanform.py ....s.. [ 80%]
..... [ 80%]
tests/openlp_plugins/planningcenter/lib/test_planningcenter_api.py ..... [ 80%]
. [ 80%]
tests/openlp_plugins/planningcenter/lib/test_planningcentertab.py .... [ 81%]
tests/openlp_plugins/planningcenter/lib/test_songimport.py ...... [ 81%]
tests/openlp_plugins/presentations/test_impresscontroller.py .......... [ 81%]
tests/openlp_plugins/presentations/test_libreofficeserver.py sssssssssss [ 82%]
sssssssssssssssssssssssssssss [ 83%]
tests/openlp_plugins/presentations/test_maclocontroller.py sssssssssssss [ 84%]
sssssssssssss [ 84%]
tests/openlp_plugins/presentations/test_mediaitem.py ......... [ 85%]
tests/openlp_plugins/presentations/test_messagelistener.py .... [ 85%]
tests/openlp_plugins/presentations/test_pdfcontroller.py .s [ 85%]
tests/openlp_plugins/presentations/test_plugin.py . [ 85%]
tests/openlp_plugins/presentations/test_powerpointcontroller.py ........ [ 85%]
. [ 85%]
tests/openlp_plugins/presentations/test_presentationcontroller.py ...... [ 86%]
...... [ 86%]
tests/openlp_plugins/presentations/test_presentationtab.py .. [ 86%]
tests/openlp_plugins/presentations/lib/test_serializers.py sss [ 86%]
tests/openlp_plugins/songs/test_chordproimport.py . [ 86%]
tests/openlp_plugins/songs/test_db.py ........... [ 87%]
tests/openlp_plugins/songs/test_easyslidesimport.py . [ 87%]
tests/openlp_plugins/songs/test_editsongform.py ... [ 87%]
tests/openlp_plugins/songs/test_ewimport.py ............... [ 87%]
tests/openlp_plugins/songs/test_foilpresenterimport.py ..... [ 88%]
tests/openlp_plugins/songs/test_lib.py ................................. [ 89%]
.. [ 89%]
tests/openlp_plugins/songs/test_liveworshipimport.py .. [ 89%]
tests/openlp_plugins/songs/test_lyriximport.py . [ 89%]
tests/openlp_plugins/songs/test_mediaitem.py ................. [ 90%]
tests/openlp_plugins/songs/test_mediashout.py sssssss [ 90%]
tests/openlp_plugins/songs/test_openlpimporter.py .. [ 90%]
tests/openlp_plugins/songs/test_openlyricsexport.py ... [ 91%]
tests/openlp_plugins/songs/test_openlyricsimport.py ..... [ 91%]
tests/openlp_plugins/songs/test_openlyricsxml.py ....... [ 91%]
tests/openlp_plugins/songs/test_openoffice.py ss [ 91%]
tests/openlp_plugins/songs/test_opensongimport.py .... [ 91%]
tests/openlp_plugins/songs/test_opsproimport.py sssss [ 92%]
tests/openlp_plugins/songs/test_plugin.py . [ 92%]
tests/openlp_plugins/songs/test_powerpraiseimport.py . [ 92%]
tests/openlp_plugins/songs/test_presentationmanagerimport.py . [ 92%]
tests/openlp_plugins/songs/test_propresenterimport.py ... [ 92%]
tests/openlp_plugins/songs/test_reporting.py ... [ 92%]
tests/openlp_plugins/songs/test_singingthefaithimport.py . [ 92%]
tests/openlp_plugins/songs/test_songbeamerimport.py ....... [ 92%]
tests/openlp_plugins/songs/test_songformat.py ..... [ 93%]
tests/openlp_plugins/songs/test_songproimport.py . [ 93%]
tests/openlp_plugins/songs/test_songselect.py .......................... [ 94%]
.................. [ 95%]
tests/openlp_plugins/songs/test_songshowplusimport.py .....s [ 95%]
tests/openlp_plugins/songs/test_songstab.py ............... [ 96%]
tests/openlp_plugins/songs/test_sundayplusimport.py . [ 96%]
tests/openlp_plugins/songs/test_videopsalm.py . [ 96%]
tests/openlp_plugins/songs/test_wordsofworshipimport.py ..... [ 96%]
tests/openlp_plugins/songs/test_worshipassistantimport.py . [ 96%]
tests/openlp_plugins/songs/test_worshipcenterproimport.py sss [ 96%]
tests/openlp_plugins/songs/test_zionworximport.py ... [ 96%]
tests/openlp_plugins/songs/forms/test_authorsform.py ................. [ 97%]
tests/openlp_plugins/songs/forms/test_editsongform.py ....... [ 97%]
tests/openlp_plugins/songs/forms/test_editverseform.py ................. [ 98%]
....... [ 98%]
tests/openlp_plugins/songs/forms/test_songmaintenanceform.py ........... [ 99%]
........ [ 99%]
tests/openlp_plugins/songs/forms/test_topicsform.py ... [ 99%]
tests/openlp_plugins/songusage/test_songusage.py .... [ 99%]
tests/openlp_plugins/songusage/forms/test_songusagedeleteform.py . [ 99%]
tests/openlp_plugins/songusage/forms/test_songusagedetailform.py . [100%]
=================================== FAILURES ===================================
______________________ test_extension_loader_import_error ______________________
def test_extension_loader_import_error():
"""
Test the `extension_loader` function when `SourceFileLoader` raises a `ImportError`
"""
# GIVEN: A mocked `import_module` which raises an `ImportError`
> with patch('openlp.core.common.applocation.AppLocation.get_directory',
return_value=Path('/', 'app', 'dir', 'openlp')), \
patch.object(Path, 'glob', return_value=[
Path('/', 'app', 'dir', 'openlp', 'import_dir', 'file1.py')]), \
patch('openlp.core.common.importlib.import_module', side_effect=ImportError()), \
patch('openlp.core.common.log') as mocked_logger:
tests/openlp_core/common/test_init.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.11/unittest/mock.py:1421: in __enter__
self.target = self.getter()
/usr/lib/python3.11/pkgutil.py:700: in resolve_name
mod = importlib.import_module(modname)
/usr/lib/python3.11/unittest/mock.py:1118: in __call__
return self._mock_call(*args, **kwargs)
/usr/lib/python3.11/unittest/mock.py:1122: in _mock_call
return self._execute_mock_call(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <MagicMock name='import_module' id='140642550500368'>, args = ('openlp',)
kwargs = {}, effect = ImportError()
def _execute_mock_call(self, /, *args, **kwargs):
# separate from _increment_mock_call so that awaited functions are
# executed separately from their call, also AsyncMock overrides this method
effect = self.side_effect
if effect is not None:
if _is_exception(effect):
> raise effect
E ImportError
/usr/lib/python3.11/unittest/mock.py:1177: ImportError
________________________ test_extension_loader_os_error ________________________
def test_extension_loader_os_error():
"""
Test the `extension_loader` function when `import_module` raises a `ImportError`
"""
# GIVEN: A mocked `SourceFileLoader` which raises an `OSError`
> with patch('openlp.core.common.applocation.AppLocation.get_directory',
return_value=Path('/', 'app', 'dir', 'openlp')), \
patch.object(Path, 'glob', return_value=[
Path('/', 'app', 'dir', 'openlp', 'import_dir', 'file1.py')]), \
patch('openlp.core.common.importlib.import_module', side_effect=OSError()), \
patch('openlp.core.common.log') as mocked_logger:
tests/openlp_core/common/test_init.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.11/unittest/mock.py:1421: in __enter__
self.target = self.getter()
/usr/lib/python3.11/pkgutil.py:700: in resolve_name
mod = importlib.import_module(modname)
/usr/lib/python3.11/unittest/mock.py:1118: in __call__
return self._mock_call(*args, **kwargs)
/usr/lib/python3.11/unittest/mock.py:1122: in _mock_call
return self._execute_mock_call(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <MagicMock name='import_module' id='140642548536080'>, args = ('openlp',)
kwargs = {}, effect = OSError()
def _execute_mock_call(self, /, *args, **kwargs):
# separate from _increment_mock_call so that awaited functions are
# executed separately from their call, also AsyncMock overrides this method
effect = self.side_effect
if effect is not None:
if _is_exception(effect):
> raise effect
E OSError
/usr/lib/python3.11/unittest/mock.py:1177: OSError
____________________________ test_to_dict_text_item ____________________________
mocked_sha256_file_hash = <MagicMock name='sha256_file_hash' id='140642545811216'>
state_media = None
settings = <openlp.core.common.settings.Settings object at 0x7fe9e5168430>
service_item_env = None
@patch('openlp.core.lib.serviceitem.sha256_file_hash')
def test_to_dict_text_item(mocked_sha256_file_hash, state_media, settings, service_item_env):
"""
Test that the to_dict() method returns the correct data for the service item
"""
# GIVEN: A ServiceItem with a service loaded from file
mocked_plugin = MagicMock()
mocked_plugin.name = 'songs'
service_item = ServiceItem(mocked_plugin)
service_item.add_icon = MagicMock()
mocked_sha256_file_hash.return_value = 'abcd'
FormattingTags.load_tags()
line = convert_file_service_item(TEST_PATH, 'serviceitem-song-linked-audio.osj')
if is_win():
fake_path = Path('c:\\test\\')
else:
fake_path = Path('/test/')
service_item.set_from_service(line, fake_path)
# WHEN: to_dict() is called
result = service_item.to_dict()
# THEN: The correct dictionary should be returned
expected_fake_path = fake_path / 'amazing_grace.mp3'
expected_dict = {
'audit': ['Amazing Grace', ['John Newton'], '', ''],
'backgroundAudio': [(expected_fake_path, 'abcd')],
'capabilities': [2, 1, 5, 8, 9, 13, 15],
'footer': ['Amazing Grace', 'Written by: John Newton'],
'fromPlugin': False,
'isThemeOverwritten': False,
'name': 'songs',
'notes': '',
'slides': [
{
'chords': 'Amazing Grace! how sweet the sound\n'
'That saved a wretch like me;\n'
'I once was lost, but now am found,\n'
'Was blind, but now I see.',
'html': 'Amazing Grace! how sweet the sound\n'
'That saved a wretch like me;\n'
'I once was lost, but now am found,\n'
'Was blind, but now I see.',
'selected': False,
'tag': 'V1',
'text': 'Amazing Grace! how sweet the sound\n'
'That saved a wretch like me;\n'
'I once was lost, but now am found,\n'
'Was blind, but now I see.',
'title': 'Amazing Grace',
'footer': 'Amazing Grace<br>Written by: John Newton'
},
{
'chords': '’Twas grace that taught my heart to fear,\n'
'And grace my fears relieved;\n'
'How precious did that grace appear,\n'
'The hour I first believed!',
'html': '’Twas grace that taught my heart to fear,\n'
'And grace my fears relieved;\n'
'How precious did that grace appear,\n'
'The hour I first believed!',
'selected': False,
'tag': 'V2',
'text': '’Twas grace that taught my heart to fear,\n'
'And grace my fears relieved;\n'
'How precious did that grace appear,\n'
'The hour I first believed!',
'title': 'Amazing Grace',
'footer': 'Amazing Grace<br>Written by: John Newton'
},
{
'chords': 'Through many dangers, toils and snares\n'
'I have already come;\n'
'’Tis grace that brought me safe thus far,\n'
'And grace will lead me home.',
'html': 'Through many dangers, toils and snares\n'
'I have already come;\n'
'’Tis grace that brought me safe thus far,\n'
'And grace will lead me home.',
'selected': False,
'tag': 'V3',
'text': 'Through many dangers, toils and snares\n'
'I have already come;\n'
'’Tis grace that brought me safe thus far,\n'
'And grace will lead me home.',
'title': 'Amazing Grace',
'footer': 'Amazing Grace<br>Written by: John Newton'
},
{
'chords': 'The Lord has promised good to me,\n'
'His word my hope secures;\n'
'He will my shield and portion be\n'
'As long as life endures.',
'html': 'The Lord has promised good to me,\n'
'His word my hope secures;\n'
'He will my shield and portion be\n'
'As long as life endures.',
'selected': False,
'tag': 'V4',
'text': 'The Lord has promised good to me,\n'
'His word my hope secures;\n'
'He will my shield and portion be\n'
'As long as life endures.',
'title': 'Amazing Grace',
'footer': 'Amazing Grace<br>Written by: John Newton'
},
{
'chords': 'Yes, when this heart and flesh shall fail,\n'
'And mortal life shall cease,\n'
'I shall possess within the veil\n'
'A life of joy and peace.',
'html': 'Yes, when this heart and flesh shall fail,\n'
'And mortal life shall cease,\n'
'I shall possess within the veil\n'
'A life of joy and peace.',
'selected': False,
'tag': 'V5',
'text': 'Yes, when this heart and flesh shall fail,\n'
'And mortal life shall cease,\n'
'I shall possess within the veil\n'
'A life of joy and peace.',
'title': 'Amazing Grace',
'footer': 'Amazing Grace<br>Written by: John Newton'
},
{
'chords': 'When we’ve been there a thousand years,\n'
'Bright shining as the sun,\n'
'We’ve no less days to sing God’s praise\n'
'Than when we first begun.',
'html': 'When we’ve been there a thousand years,\n'
'Bright shining as the sun,\n'
'We’ve no less days to sing God’s praise\n'
'Than when we first begun.',
'selected': False,
'tag': 'V6',
'text': 'When we’ve been there a thousand years,\n'
'Bright shining as the sun,\n'
'We’ve no less days to sing God’s praise\n'
'Than when we first begun.',
'title': 'Amazing Grace',
'footer': 'Amazing Grace<br>Written by: John Newton'
}
],
'theme': None,
'title': 'Amazing Grace',
'type': 'ServiceItemType.Text',
'data': {'authors': 'John Newton', 'title': 'amazing grace@'}
}
> assert result == expected_dict
E AssertionError: assert {'audit': ['A...grace@'}, ...} == {'audit': ['A...grace@'}, ...}
E Omitting 12 identical items, use -vv to show
E Differing items:
E {'type': '1'} != {'type': 'ServiceItemType.Text'}
E Use -v to get more diff
tests/openlp_core/lib/test_serviceitem.py:868: AssertionError
------------------------------ Captured log setup ------------------------------
INFO openlp.core.common.registry:registry.py:44 Registry Initialising
___________________________ test_to_dict_image_item ____________________________
state_media = None
settings = <openlp.core.common.settings.Settings object at 0x7fe9e4eb7520>
service_item_env = None
def test_to_dict_image_item(state_media, settings, service_item_env):
"""
Test that the to_dict() method returns the correct data for the service item
"""
# GIVEN: A ServiceItem with a service loaded from file
mocked_plugin = MagicMock()
mocked_plugin.name = 'image'
service_item = ServiceItem(mocked_plugin)
service_item.add_icon = MagicMock()
FormattingTags.load_tags()
line = convert_file_service_item(TEST_PATH, 'serviceitem_image_2.osj')
service_item.set_from_service(line)
# WHEN: to_dict() is called
result = service_item.to_dict()
# THEN: The correct dictionary should be returned
expected_dict = {
'audit': '',
'backgroundAudio': [],
'capabilities': [3, 1, 5, 6],
'footer': [],
'fromPlugin': False,
'isThemeOverwritten': False,
'name': 'images',
'notes': '',
'slides': [
{
'html': 'image_1.jpg',
'selected': False,
'tag': 1,
'text': 'image_1.jpg',
'title': 'Images'
}
],
'theme': -1,
'title': 'Images',
'type': 'ServiceItemType.Image',
'data': {}
}
> assert result == expected_dict
E AssertionError: assert {'audit': '',...ata': {}, ...} == {'audit': '',...ata': {}, ...}
E Omitting 12 identical items, use -vv to show
E Differing items:
E {'type': '2'} != {'type': 'ServiceItemType.Image'}
E Use -v to get more diff
tests/openlp_core/lib/test_serviceitem.py:911: AssertionError
------------------------------ Captured log setup ------------------------------
INFO openlp.core.common.registry:registry.py:44 Registry Initialising
________________________ test_to_dict_presentation_item ________________________
mocked_image_uri = <MagicMock name='image_to_data_uri' id='140642545730448'>
mocked_get_data_path = <MagicMock name='get_data_path' id='140642545730000'>
state_media = None
settings = <openlp.core.common.settings.Settings object at 0x7fe9e4eb7880>
service_item_env = None
@patch('openlp.core.lib.serviceitem.AppLocation.get_data_path')
@patch('openlp.core.lib.serviceitem.image_to_data_uri')
def test_to_dict_presentation_item(mocked_image_uri, mocked_get_data_path, state_media, settings, service_item_env):
"""
Test that the to_dict() method returns the correct data for the service item
"""
# GIVEN: A ServiceItem with a service loaded from file
mocked_plugin = MagicMock()
mocked_plugin.name = 'presentations'
service_item = ServiceItem(mocked_plugin)
service_item.capabilities = [ItemCapabilities.HasThumbnails]
presentation_name = 'test.pptx'
mocked_get_data_path.return_value = Path('/path/to/')
image = Path('thumbnails/abcd/slide1.png')
display_title = 'DisplayTitle'
notes = 'Note1\nNote2\n'
mocked_image_uri.side_effect = lambda x: 'your img uri at: {}'.format(x.as_posix())
# WHEN: adding presentation to service_item
with patch('openlp.core.lib.serviceitem.sha256_file_hash') as mocked_sha256_file_hash,\
patch('openlp.core.lib.serviceitem.AppLocation.get_section_data_path') as mocked_get_section_data_path:
mocked_sha256_file_hash.return_value = '4a067fed6834ea2bc4b8819f11636365'
mocked_get_section_data_path.return_value = Path('/path/to/presentations/')
service_item.add_from_command(TEST_PATH, presentation_name, image, display_title, notes)
# WHEN: to_dict() is called
result = service_item.to_dict()
# THEN: The correct dictionary should be returned
expected_dict = {
'audit': '',
'backgroundAudio': [],
'capabilities': [21],
'footer': [],
'fromPlugin': False,
'isThemeOverwritten': False,
'name': 'presentations',
'notes': '',
'slides': [
{
'html': 'test.pptx',
'selected': False,
'tag': 1,
'text': 'test.pptx',
'title': '',
'img': 'your img uri at: /path/to/presentations/thumbnails/4a067fed6834ea2bc4b8819f11636365/slide1.png'
}
],
'theme': None,
'title': '',
'type': 'ServiceItemType.Command',
'data': {}
}
> assert result == expected_dict
E AssertionError: assert {'audit': '',...ata': {}, ...} == {'audit': '',...ata': {}, ...}
E Omitting 12 identical items, use -vv to show
E Differing items:
E {'type': '3'} != {'type': 'ServiceItemType.Command'}
E Use -v to get more diff
tests/openlp_core/lib/test_serviceitem.py:967: AssertionError
------------------------------ Captured log setup ------------------------------
INFO openlp.core.common.registry:registry.py:44 Registry Initialising
=============================== warnings summary ===============================
../../usr/lib/python3.11/site-packages/webob/compat.py:5
/usr/lib/python3.11/site-packages/webob/compat.py:5: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
from cgi import parse_header
openlp/core/api/tab.py:25
/builddir/OpenLP-3.0.0/openlp/core/api/tab.py:25: DeprecationWarning: Support for PyQt5 is deprecated and will be removed in Pillow 10 (2023-07-01). Use PyQt6 or PySide6 instead.
import PIL.ImageQt
tests/openlp_core/api/test_tab.py: 95 warnings
tests/openlp_core/ui/test_icons.py: 1 warning
/usr/lib/python3.11/site-packages/qtawesome/iconic_font.py:394: DeprecationWarning: The FontAwesome 4.7 ('fa' prefix) icon set will be removed in a future release in favor of FontAwesome 6. We recommend you to move to FontAwesome 5 ('fa5*' prefix) to prevent any issues in the future
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/openlp_core/common/test_init.py::test_extension_loader_import_error
FAILED tests/openlp_core/common/test_init.py::test_extension_loader_os_error
FAILED tests/openlp_core/lib/test_serviceitem.py::test_to_dict_text_item - As...
FAILED tests/openlp_core/lib/test_serviceitem.py::test_to_dict_image_item - A...
FAILED tests/openlp_core/lib/test_serviceitem.py::test_to_dict_presentation_item
===== 5 failed, 2152 passed, 108 skipped, 98 warnings in 71.09s (0:01:11) ======
```
next prev parent reply other threads:[~2023-01-09 13:36 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-08 22:12 [PR PATCH] " joelchrono12
2023-01-08 23:39 ` [PR PATCH] [Updated] " joelchrono12
2023-01-09 1:33 ` joelchrono12
2023-01-09 1:42 ` joelchrono12
2023-01-09 13:36 ` TinfoilSubmarine [this message]
2023-01-09 14:27 ` joelchrono12
2023-01-09 14:36 ` TinfoilSubmarine
2023-01-09 14:37 ` TinfoilSubmarine
2023-01-09 17:33 ` joelchrono12
2023-01-09 17:33 ` joelchrono12
2023-01-10 15:49 ` TinfoilSubmarine
2023-01-10 16:03 ` TinfoilSubmarine
2023-01-10 16:22 ` joelchrono12
2023-01-10 16:23 ` joelchrono12
2023-01-10 16:23 ` joelchrono12
2023-01-10 16:37 ` TinfoilSubmarine
2023-01-10 16:51 ` [PR PATCH] [Updated] " joelchrono12
2023-01-10 16:52 ` joelchrono12
2023-01-20 16:28 ` TinfoilSubmarine
2023-02-23 20:11 ` [PR PATCH] [Updated] " Chocimier
2023-02-23 20:12 ` Chocimier
2023-02-26 15:59 ` joelchrono12
2023-03-22 21:40 ` [PR PATCH] [Merged]: " Chocimier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230109133649.0cqsxDxbfJB-ZgxCeOKGxyNOcdZwwDNtXNvh_81LBo0@z \
--to=tinfoilsubmarine@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).