forked from openlp/openlp
tests
This commit is contained in:
parent
5495ba8cf3
commit
f9e20e2108
@ -22,7 +22,6 @@
|
|||||||
"""
|
"""
|
||||||
Base directory for tests
|
Base directory for tests
|
||||||
"""
|
"""
|
||||||
import sys
|
|
||||||
from PyQt5 import QtWidgets
|
from PyQt5 import QtWidgets
|
||||||
|
|
||||||
# Only one QApplication can be created. Use QtWidgets.QApplication.instance() when you need to "create" a QApplication.
|
# Only one QApplication can be created. Use QtWidgets.QApplication.instance() when you need to "create" a QApplication.
|
||||||
|
@ -28,9 +28,9 @@ from unittest.mock import patch
|
|||||||
|
|
||||||
from PyQt5 import QtWidgets
|
from PyQt5 import QtWidgets
|
||||||
|
|
||||||
|
from openlp.core.api.tab import ApiTab
|
||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.core.common.settings import Settings
|
from openlp.core.common.settings import Settings
|
||||||
from openlp.core.api.tab import ApiTab
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
__default_settings__ = {
|
__default_settings__ = {
|
||||||
|
@ -25,10 +25,10 @@ Functional tests to test the Http Server Class.
|
|||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
|
from openlp.core.api.poll import Poller
|
||||||
|
from openlp.core.api.websockets import WebSocketServer
|
||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.core.common.settings import Settings
|
from openlp.core.common.settings import Settings
|
||||||
from openlp.core.api.websockets import WebSocketServer
|
|
||||||
from openlp.core.api.poll import Poller
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
__default_settings__ = {
|
__default_settings__ = {
|
||||||
|
@ -29,7 +29,6 @@ from PyQt5 import QtGui, QtCore, QtWidgets
|
|||||||
|
|
||||||
from openlp.core.common.actions import CategoryActionList, ActionList
|
from openlp.core.common.actions import CategoryActionList, ActionList
|
||||||
from openlp.core.common.settings import Settings
|
from openlp.core.common.settings import Settings
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ from unittest.mock import MagicMock, patch
|
|||||||
|
|
||||||
from openlp.core.common.httputils import get_user_agent, get_web_page, get_url_file_size, url_get_file
|
from openlp.core.common.httputils import get_user_agent, get_web_page, get_url_file_size, url_get_file
|
||||||
from openlp.core.common.path import Path
|
from openlp.core.common.path import Path
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
"""
|
"""
|
||||||
Functional tests to test the AppLocation class and related methods.
|
Functional tests to test the AppLocation class and related methods.
|
||||||
"""
|
"""
|
||||||
import os
|
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from unittest.mock import MagicMock, PropertyMock, call, patch
|
from unittest.mock import MagicMock, PropertyMock, call, patch
|
||||||
@ -30,7 +29,6 @@ from unittest.mock import MagicMock, PropertyMock, call, patch
|
|||||||
from openlp.core.common import add_actions, clean_filename, delete_file, get_file_encoding, get_filesystem_encoding, \
|
from openlp.core.common import add_actions, clean_filename, delete_file, get_file_encoding, get_filesystem_encoding, \
|
||||||
get_uno_command, get_uno_instance
|
get_uno_command, get_uno_instance
|
||||||
from openlp.core.common.path import Path
|
from openlp.core.common.path import Path
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,8 +26,8 @@ import json
|
|||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from openlp.core.common.path import Path
|
|
||||||
from openlp.core.common.json import OpenLPJsonDecoder, OpenLPJsonEncoder
|
from openlp.core.common.json import OpenLPJsonDecoder, OpenLPJsonEncoder
|
||||||
|
from openlp.core.common.path import Path
|
||||||
|
|
||||||
|
|
||||||
class TestOpenLPJsonDecoder(TestCase):
|
class TestOpenLPJsonDecoder(TestCase):
|
||||||
|
@ -26,7 +26,6 @@ Package to test the openlp.core.ui.projector.networkutils package.
|
|||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
|
||||||
from openlp.core.common import verify_ip_address, md5_hash, qmd5_hash
|
from openlp.core.common import verify_ip_address, md5_hash, qmd5_hash
|
||||||
|
|
||||||
from tests.resources.projector.data import TEST_PIN, TEST_SALT, TEST_HASH
|
from tests.resources.projector.data import TEST_PIN, TEST_SALT, TEST_HASH
|
||||||
|
|
||||||
salt = TEST_SALT
|
salt = TEST_SALT
|
||||||
|
@ -28,7 +28,6 @@ from unittest.mock import call, patch
|
|||||||
|
|
||||||
from openlp.core.common import settings
|
from openlp.core.common import settings
|
||||||
from openlp.core.common.settings import Settings, media_players_conv
|
from openlp.core.common.settings import Settings, media_players_conv
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,12 +28,11 @@ from unittest.mock import MagicMock, patch
|
|||||||
from PyQt5 import QtCore
|
from PyQt5 import QtCore
|
||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.core.display.screens import ScreenList
|
|
||||||
from openlp.core.display.renderer import Renderer, words_split, get_start_tags
|
from openlp.core.display.renderer import Renderer, words_split, get_start_tags
|
||||||
|
from openlp.core.display.screens import ScreenList
|
||||||
from openlp.core.lib import ServiceItem
|
from openlp.core.lib import ServiceItem
|
||||||
from openlp.core.lib.theme import Theme
|
from openlp.core.lib.theme import Theme
|
||||||
|
|
||||||
|
|
||||||
SCREEN = {
|
SCREEN = {
|
||||||
'primary': False,
|
'primary': False,
|
||||||
'number': 1,
|
'number': 1,
|
||||||
|
@ -23,14 +23,13 @@
|
|||||||
Package to test the openlp.core.lib package.
|
Package to test the openlp.core.lib package.
|
||||||
"""
|
"""
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
from tempfile import mkdtemp
|
from tempfile import mkdtemp
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from unittest.mock import patch, MagicMock
|
from unittest.mock import patch, MagicMock
|
||||||
|
|
||||||
from sqlalchemy.pool import NullPool
|
|
||||||
from sqlalchemy.orm.scoping import ScopedSession
|
|
||||||
from sqlalchemy import MetaData
|
from sqlalchemy import MetaData
|
||||||
|
from sqlalchemy.orm.scoping import ScopedSession
|
||||||
|
from sqlalchemy.pool import NullPool
|
||||||
|
|
||||||
from openlp.core.common.path import Path
|
from openlp.core.common.path import Path
|
||||||
from openlp.core.lib.db import init_db, get_upgrade_op, delete_database, upgrade_db
|
from openlp.core.lib.db import init_db, get_upgrade_op, delete_database, upgrade_db
|
||||||
|
@ -10,7 +10,6 @@ from openlp.core.common.settings import Settings
|
|||||||
from openlp.core.lib.htmlbuilder import build_html, build_background_css, build_lyrics_css, build_lyrics_outline_css, \
|
from openlp.core.lib.htmlbuilder import build_html, build_background_css, build_lyrics_css, build_lyrics_outline_css, \
|
||||||
build_lyrics_format_css, build_footer_css, webkit_version, build_chords_css
|
build_lyrics_format_css, build_footer_css, webkit_version, build_chords_css
|
||||||
from openlp.core.lib.theme import HorizontalType, VerticalType
|
from openlp.core.lib.theme import HorizontalType, VerticalType
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
HTML = """
|
HTML = """
|
||||||
|
@ -33,7 +33,6 @@ from PyQt5 import QtGui
|
|||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.core.display.screens import ScreenList
|
from openlp.core.display.screens import ScreenList
|
||||||
from openlp.core.lib.imagemanager import ImageManager, Priority
|
from openlp.core.lib.imagemanager import ImageManager, Priority
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
from tests.utils.constants import RESOURCE_PATH
|
from tests.utils.constants import RESOURCE_PATH
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@ from unittest import TestCase
|
|||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
from openlp.core.lib import MediaManagerItem
|
from openlp.core.lib import MediaManagerItem
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,8 +27,8 @@ from unittest.mock import MagicMock
|
|||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.core.common.settings import Settings
|
from openlp.core.common.settings import Settings
|
||||||
from openlp.core.lib.pluginmanager import PluginManager
|
|
||||||
from openlp.core.lib import PluginStatus
|
from openlp.core.lib import PluginStatus
|
||||||
|
from openlp.core.lib.pluginmanager import PluginManager
|
||||||
|
|
||||||
|
|
||||||
class TestPluginManager(TestCase):
|
class TestPluginManager(TestCase):
|
||||||
|
@ -30,7 +30,6 @@ from openlp.core.common import md5_hash
|
|||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.core.common.settings import Settings
|
from openlp.core.common.settings import Settings
|
||||||
from openlp.core.lib import ItemCapabilities, ServiceItem, ServiceItemType, FormattingTags
|
from openlp.core.lib import ItemCapabilities, ServiceItem, ServiceItemType, FormattingTags
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
from tests.utils import assert_length, convert_file_service_item
|
from tests.utils import assert_length, convert_file_service_item
|
||||||
from tests.utils.constants import RESOURCE_PATH
|
from tests.utils.constants import RESOURCE_PATH
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
"""
|
"""
|
||||||
Package to test the openlp.core.lib.theme package.
|
Package to test the openlp.core.lib.theme package.
|
||||||
"""
|
"""
|
||||||
import os
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@ from unittest import TestCase
|
|||||||
|
|
||||||
from openlp.core.projectors.db import Projector
|
from openlp.core.projectors.db import Projector
|
||||||
from openlp.core.projectors.pjlink import PJLink
|
from openlp.core.projectors.pjlink import PJLink
|
||||||
|
|
||||||
from tests.resources.projector.data import TEST1_DATA
|
from tests.resources.projector.data import TEST1_DATA
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@ PREREQUISITE: add_record() and get_all() functions validated.
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
from tempfile import mkdtemp
|
from tempfile import mkdtemp
|
||||||
|
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
@ -36,7 +35,6 @@ from openlp.core.lib.db import upgrade_db
|
|||||||
from openlp.core.projectors import upgrade
|
from openlp.core.projectors import upgrade
|
||||||
from openlp.core.projectors.constants import PJLINK_PORT
|
from openlp.core.projectors.constants import PJLINK_PORT
|
||||||
from openlp.core.projectors.db import Manufacturer, Model, Projector, ProjectorDB, ProjectorSource, Source
|
from openlp.core.projectors.db import Manufacturer, Model, Projector, ProjectorDB, ProjectorSource, Source
|
||||||
|
|
||||||
from tests.resources.projector.data import TEST_DB_PJLINK1, TEST_DB, TEST1_DATA, TEST2_DATA, TEST3_DATA
|
from tests.resources.projector.data import TEST_DB_PJLINK1, TEST_DB, TEST1_DATA, TEST2_DATA, TEST3_DATA
|
||||||
from tests.utils.constants import TEST_RESOURCES_PATH
|
from tests.utils.constants import TEST_RESOURCES_PATH
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@ from unittest.mock import call, patch, MagicMock
|
|||||||
from openlp.core.projectors.constants import E_PARAMETER, ERROR_STRING, S_ON, S_CONNECTED, S_QSOCKET_STATE
|
from openlp.core.projectors.constants import E_PARAMETER, ERROR_STRING, S_ON, S_CONNECTED, S_QSOCKET_STATE
|
||||||
from openlp.core.projectors.db import Projector
|
from openlp.core.projectors.db import Projector
|
||||||
from openlp.core.projectors.pjlink import PJLink
|
from openlp.core.projectors.pjlink import PJLink
|
||||||
|
|
||||||
from tests.resources.projector.data import TEST1_DATA
|
from tests.resources.projector.data import TEST1_DATA
|
||||||
|
|
||||||
pjlink_test = PJLink(Projector(**TEST1_DATA), no_poll=True)
|
pjlink_test = PJLink(Projector(**TEST1_DATA), no_poll=True)
|
||||||
|
@ -32,7 +32,6 @@ from openlp.core.projectors.constants import ERROR_STRING, PJLINK_ERST_DATA, PJL
|
|||||||
S_CONNECTED, S_OFF, S_ON, S_NOT_CONNECTED, S_CONNECTING, S_STANDBY
|
S_CONNECTED, S_OFF, S_ON, S_NOT_CONNECTED, S_CONNECTING, S_STANDBY
|
||||||
from openlp.core.projectors.db import Projector
|
from openlp.core.projectors.db import Projector
|
||||||
from openlp.core.projectors.pjlink import PJLink
|
from openlp.core.projectors.pjlink import PJLink
|
||||||
|
|
||||||
from tests.resources.projector.data import TEST_PIN, TEST1_DATA
|
from tests.resources.projector.data import TEST_PIN, TEST1_DATA
|
||||||
|
|
||||||
pjlink_test = PJLink(Projector(**TEST1_DATA), pin=TEST_PIN, no_poll=True)
|
pjlink_test = PJLink(Projector(**TEST1_DATA), pin=TEST_PIN, no_poll=True)
|
||||||
|
@ -29,7 +29,6 @@ import openlp.core.projectors.pjlink
|
|||||||
from openlp.core.projectors.constants import S_CONNECTED
|
from openlp.core.projectors.constants import S_CONNECTED
|
||||||
from openlp.core.projectors.db import Projector
|
from openlp.core.projectors.db import Projector
|
||||||
from openlp.core.projectors.pjlink import PJLink
|
from openlp.core.projectors.pjlink import PJLink
|
||||||
|
|
||||||
from tests.resources.projector.data import TEST_HASH, TEST_PIN, TEST_SALT, TEST1_DATA
|
from tests.resources.projector.data import TEST_HASH, TEST_PIN, TEST_SALT, TEST1_DATA
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
from unittest import TestCase, skip
|
from unittest import TestCase, skip
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock, patch
|
||||||
@ -28,7 +27,6 @@ from PyQt5 import QtCore, QtWidgets
|
|||||||
|
|
||||||
from openlp.core.app import OpenLP, parse_options
|
from openlp.core.app import OpenLP, parse_options
|
||||||
from openlp.core.common.settings import Settings
|
from openlp.core.common.settings import Settings
|
||||||
|
|
||||||
from tests.utils.constants import RESOURCE_PATH
|
from tests.utils.constants import RESOURCE_PATH
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ from unittest import TestCase
|
|||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from openlp.core.ui.aboutform import AboutForm
|
from openlp.core.ui.aboutform import AboutForm
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ from unittest import TestCase
|
|||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.core.ui.advancedtab import AdvancedTab
|
from openlp.core.ui.advancedtab import AdvancedTab
|
||||||
from openlp.core.ui.settingsform import SettingsForm
|
from openlp.core.ui.settingsform import SettingsForm
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,14 +24,12 @@ Package to test the openlp.core.ui.exeptionform package.
|
|||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from unittest.mock import call, patch
|
from unittest.mock import call, patch
|
||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
|
||||||
from openlp.core.common.path import Path
|
from openlp.core.common.path import Path
|
||||||
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.core.ui import exceptionform
|
from openlp.core.ui import exceptionform
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
exceptionform.WEBKIT_VERSION = 'Webkit Test'
|
exceptionform.WEBKIT_VERSION = 'Webkit Test'
|
||||||
|
@ -26,7 +26,6 @@ from unittest import TestCase
|
|||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from openlp.core.common.httputils import CONNECTION_RETRIES, get_web_page
|
from openlp.core.common.httputils import CONNECTION_RETRIES, get_web_page
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,14 +24,12 @@ Package to test the openlp.core.ui.firsttimeform package.
|
|||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import tempfile
|
import tempfile
|
||||||
import urllib
|
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
|
||||||
from openlp.core.common.path import Path
|
from openlp.core.common.path import Path
|
||||||
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.core.ui.firsttimeform import FirstTimeForm
|
from openlp.core.ui.firsttimeform import FirstTimeForm
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
FAKE_CONFIG = """
|
FAKE_CONFIG = """
|
||||||
|
@ -34,7 +34,6 @@ from openlp.core.display.screens import ScreenList
|
|||||||
from openlp.core.lib import PluginManager
|
from openlp.core.lib import PluginManager
|
||||||
from openlp.core.ui import MainDisplay, AudioPlayer
|
from openlp.core.ui import MainDisplay, AudioPlayer
|
||||||
from openlp.core.ui.maindisplay import TRANSPARENT_STYLESHEET, OPAQUE_STYLESHEET
|
from openlp.core.ui.maindisplay import TRANSPARENT_STYLESHEET, OPAQUE_STYLESHEET
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
if is_macosx():
|
if is_macosx():
|
||||||
|
@ -32,7 +32,6 @@ from openlp.core.common.i18n import UiStrings
|
|||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.core.display.screens import ScreenList
|
from openlp.core.display.screens import ScreenList
|
||||||
from openlp.core.ui.mainwindow import MainWindow
|
from openlp.core.ui.mainwindow import MainWindow
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
from tests.utils.constants import TEST_RESOURCES_PATH
|
from tests.utils.constants import TEST_RESOURCES_PATH
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@ from unittest.mock import patch
|
|||||||
from PyQt5 import QtCore
|
from PyQt5 import QtCore
|
||||||
|
|
||||||
from openlp.core.ui.media import get_media_players, parse_optical_path
|
from openlp.core.ui.media import get_media_players, parse_optical_path
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,10 +30,9 @@ from unittest.mock import ANY, MagicMock, patch
|
|||||||
|
|
||||||
from PyQt5 import QtWidgets
|
from PyQt5 import QtWidgets
|
||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
|
||||||
from openlp.core.common.path import Path
|
from openlp.core.common.path import Path
|
||||||
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.core.ui import ThemeManager
|
from openlp.core.ui import ThemeManager
|
||||||
|
|
||||||
from tests.utils.constants import TEST_RESOURCES_PATH
|
from tests.utils.constants import TEST_RESOURCES_PATH
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,9 +26,8 @@ from unittest import TestCase
|
|||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.core.ui.themestab import ThemesTab
|
|
||||||
from openlp.core.ui.settingsform import SettingsForm
|
from openlp.core.ui.settingsform import SettingsForm
|
||||||
|
from openlp.core.ui.themestab import ThemesTab
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,9 +27,9 @@ from unittest import TestCase
|
|||||||
from unittest.mock import MagicMock, PropertyMock, patch
|
from unittest.mock import MagicMock, PropertyMock, patch
|
||||||
|
|
||||||
from openlp.core.common.path import Path
|
from openlp.core.common.path import Path
|
||||||
from openlp.core.widgets.enums import PathEditType
|
|
||||||
from openlp.core.widgets.dialogs import FileDialog
|
from openlp.core.widgets.dialogs import FileDialog
|
||||||
from openlp.core.widgets.edits import PathEdit
|
from openlp.core.widgets.edits import PathEdit
|
||||||
|
from openlp.core.widgets.enums import PathEditType
|
||||||
|
|
||||||
|
|
||||||
class TestPathEdit(TestCase):
|
class TestPathEdit(TestCase):
|
||||||
|
@ -22,10 +22,8 @@
|
|||||||
"""
|
"""
|
||||||
This module contains tests for the CSV Bible importer.
|
This module contains tests for the CSV Bible importer.
|
||||||
"""
|
"""
|
||||||
import os
|
|
||||||
import json
|
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.plugins.alerts.lib.alertsmanager import AlertsManager
|
from openlp.plugins.alerts.lib.alertsmanager import AlertsManager
|
||||||
|
@ -26,8 +26,8 @@ from io import BytesIO
|
|||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
from lxml import etree, objectify
|
|
||||||
from PyQt5.QtWidgets import QDialog
|
from PyQt5.QtWidgets import QDialog
|
||||||
|
from lxml import etree, objectify
|
||||||
|
|
||||||
from openlp.core.common.i18n import Language
|
from openlp.core.common.i18n import Language
|
||||||
from openlp.core.common.path import Path
|
from openlp.core.common.path import Path
|
||||||
|
@ -31,7 +31,6 @@ from openlp.core.common.path import Path
|
|||||||
from openlp.core.lib.exceptions import ValidationError
|
from openlp.core.lib.exceptions import ValidationError
|
||||||
from openlp.plugins.bibles.lib.bibleimport import BibleImport
|
from openlp.plugins.bibles.lib.bibleimport import BibleImport
|
||||||
from openlp.plugins.bibles.lib.importers.csvbible import Book, CSVBible, Verse
|
from openlp.plugins.bibles.lib.importers.csvbible import Book, CSVBible, Verse
|
||||||
|
|
||||||
from tests.utils import load_external_result_data
|
from tests.utils import load_external_result_data
|
||||||
from tests.utils.constants import RESOURCE_PATH
|
from tests.utils.constants import RESOURCE_PATH
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ from unittest.mock import MagicMock, patch
|
|||||||
|
|
||||||
from openlp.plugins.bibles import lib
|
from openlp.plugins.bibles import lib
|
||||||
from openlp.plugins.bibles.lib import SearchResults, get_reference_match
|
from openlp.plugins.bibles.lib import SearchResults, get_reference_match
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,12 +27,11 @@ from unittest.mock import MagicMock, call, patch
|
|||||||
|
|
||||||
from PyQt5 import QtCore, QtWidgets
|
from PyQt5 import QtCore, QtWidgets
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
|
||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.core.lib import MediaManagerItem
|
from openlp.core.lib import MediaManagerItem
|
||||||
from openlp.plugins.bibles.lib.mediaitem import BibleMediaItem, BibleSearch, ResultsTab, SearchStatus, SearchTabs, \
|
from openlp.plugins.bibles.lib.mediaitem import BibleMediaItem, BibleSearch, ResultsTab, SearchStatus, SearchTabs, \
|
||||||
get_reference_separators, VALID_TEXT_SEARCH
|
get_reference_separators, VALID_TEXT_SEARCH
|
||||||
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
class TestBibleMediaItemModulefunctions(TestCase):
|
class TestBibleMediaItemModulefunctions(TestCase):
|
||||||
|
@ -28,7 +28,6 @@ from unittest.mock import MagicMock, call, patch
|
|||||||
from openlp.plugins.bibles.lib.bibleimport import BibleImport
|
from openlp.plugins.bibles.lib.bibleimport import BibleImport
|
||||||
from openlp.plugins.bibles.lib.db import BibleDB
|
from openlp.plugins.bibles.lib.db import BibleDB
|
||||||
from openlp.plugins.bibles.lib.importers.osis import OSISBible
|
from openlp.plugins.bibles.lib.importers.osis import OSISBible
|
||||||
|
|
||||||
from tests.utils import load_external_result_data
|
from tests.utils import load_external_result_data
|
||||||
from tests.utils.constants import RESOURCE_PATH
|
from tests.utils.constants import RESOURCE_PATH
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ from unittest.mock import MagicMock, patch
|
|||||||
|
|
||||||
from openlp.plugins.bibles.lib.db import BibleDB
|
from openlp.plugins.bibles.lib.db import BibleDB
|
||||||
from openlp.plugins.bibles.lib.importers.zefania import ZefaniaBible
|
from openlp.plugins.bibles.lib.importers.zefania import ZefaniaBible
|
||||||
|
|
||||||
from tests.utils import load_external_result_data
|
from tests.utils import load_external_result_data
|
||||||
from tests.utils.constants import RESOURCE_PATH
|
from tests.utils.constants import RESOURCE_PATH
|
||||||
|
|
||||||
|
@ -27,10 +27,9 @@ from unittest.mock import MagicMock, patch
|
|||||||
|
|
||||||
from PyQt5 import QtCore
|
from PyQt5 import QtCore
|
||||||
|
|
||||||
from openlp.core.common.settings import Settings
|
|
||||||
from openlp.core.common.path import Path
|
from openlp.core.common.path import Path
|
||||||
|
from openlp.core.common.settings import Settings
|
||||||
from openlp.plugins.media.lib.mediaitem import MediaMediaItem
|
from openlp.plugins.media.lib.mediaitem import MediaMediaItem
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
__default_settings__ = {
|
__default_settings__ = {
|
||||||
|
@ -27,7 +27,6 @@ from unittest.mock import patch
|
|||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.plugins.media.mediaplugin import MediaPlugin, process_check_binary
|
from openlp.plugins.media.mediaplugin import MediaPlugin, process_check_binary
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,12 +24,12 @@ This module contains tests for the db submodule of the Songs plugin.
|
|||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
from unittest import TestCase
|
|
||||||
from tempfile import mkdtemp
|
from tempfile import mkdtemp
|
||||||
|
from unittest import TestCase
|
||||||
|
|
||||||
from openlp.plugins.songs.lib.db import Song, Author, AuthorType, Book
|
|
||||||
from openlp.plugins.songs.lib import upgrade
|
|
||||||
from openlp.core.lib.db import upgrade_db
|
from openlp.core.lib.db import upgrade_db
|
||||||
|
from openlp.plugins.songs.lib import upgrade
|
||||||
|
from openlp.plugins.songs.lib.db import Song, Author, AuthorType, Book
|
||||||
from tests.utils.constants import TEST_RESOURCES_PATH
|
from tests.utils.constants import TEST_RESOURCES_PATH
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ from PyQt5 import QtCore
|
|||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.plugins.songs.forms.editsongform import EditSongForm
|
from openlp.plugins.songs.forms.editsongform import EditSongForm
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,7 +29,6 @@ from PyQt5 import QtCore
|
|||||||
|
|
||||||
from openlp.core.common.settings import Settings
|
from openlp.core.common.settings import Settings
|
||||||
from openlp.plugins.songs.forms.editverseform import EditVerseForm
|
from openlp.plugins.songs.forms.editverseform import EditVerseForm
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
__default_settings__ = {
|
__default_settings__ = {
|
||||||
|
@ -28,7 +28,6 @@ from unittest.mock import MagicMock, patch
|
|||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.plugins.songs.lib.importers.easyworship import EasyWorshipSongImport, FieldDescEntry, FieldType
|
from openlp.plugins.songs.lib.importers.easyworship import EasyWorshipSongImport, FieldDescEntry, FieldType
|
||||||
|
|
||||||
from tests.utils.constants import RESOURCE_PATH
|
from tests.utils.constants import RESOURCE_PATH
|
||||||
|
|
||||||
TEST_PATH = RESOURCE_PATH / 'easyworshipsongs'
|
TEST_PATH = RESOURCE_PATH / 'easyworshipsongs'
|
||||||
|
@ -32,7 +32,6 @@ from openlp.core.common.settings import Settings
|
|||||||
from openlp.core.lib import ServiceItem
|
from openlp.core.lib import ServiceItem
|
||||||
from openlp.plugins.songs.lib.db import AuthorType, Song
|
from openlp.plugins.songs.lib.db import AuthorType, Song
|
||||||
from openlp.plugins.songs.lib.mediaitem import SongMediaItem
|
from openlp.plugins.songs.lib.mediaitem import SongMediaItem
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ from unittest import TestCase, skipUnless
|
|||||||
from unittest.mock import MagicMock, patch, call
|
from unittest.mock import MagicMock, patch, call
|
||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from openlp.plugins.songs.lib.importers.mediashout import MediaShoutImport
|
from openlp.plugins.songs.lib.importers.mediashout import MediaShoutImport
|
||||||
CAN_RUN_TESTS = True
|
CAN_RUN_TESTS = True
|
||||||
|
@ -26,10 +26,9 @@ from tempfile import mkdtemp
|
|||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
|
||||||
from openlp.core.common.path import Path
|
from openlp.core.common.path import Path
|
||||||
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.plugins.songs.lib.openlyricsexport import OpenLyricsExport
|
from openlp.plugins.songs.lib.openlyricsexport import OpenLyricsExport
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,7 +33,6 @@ from openlp.core.common.settings import Settings
|
|||||||
from openlp.plugins.songs.lib.importers.openlyrics import OpenLyricsImport
|
from openlp.plugins.songs.lib.importers.openlyrics import OpenLyricsImport
|
||||||
from openlp.plugins.songs.lib.importers.songimport import SongImport
|
from openlp.plugins.songs.lib.importers.songimport import SongImport
|
||||||
from openlp.plugins.songs.lib.openlyricsxml import OpenLyrics
|
from openlp.plugins.songs.lib.openlyricsxml import OpenLyrics
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
from tests.utils.constants import RESOURCE_PATH
|
from tests.utils.constants import RESOURCE_PATH
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@ from unittest import TestCase, skipIf
|
|||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
|
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -27,7 +27,6 @@ from unittest.mock import patch, MagicMock
|
|||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.plugins.songs.lib.importers.opensong import OpenSongImport
|
from openlp.plugins.songs.lib.importers.opensong import OpenSongImport
|
||||||
|
|
||||||
from tests.helpers.songfileimport import SongImportTestHelper
|
from tests.helpers.songfileimport import SongImportTestHelper
|
||||||
from tests.utils.constants import RESOURCE_PATH
|
from tests.utils.constants import RESOURCE_PATH
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@ from unittest.mock import MagicMock, patch
|
|||||||
|
|
||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.plugins.songs.lib.importers.songbeamer import SongBeamerImport, SongBeamerTypes
|
from openlp.plugins.songs.lib.importers.songbeamer import SongBeamerImport, SongBeamerTypes
|
||||||
|
|
||||||
from tests.helpers.songfileimport import SongImportTestHelper
|
from tests.helpers.songfileimport import SongImportTestHelper
|
||||||
from tests.utils.constants import RESOURCE_PATH
|
from tests.utils.constants import RESOURCE_PATH
|
||||||
|
|
||||||
|
@ -33,7 +33,6 @@ from openlp.core.common.registry import Registry
|
|||||||
from openlp.plugins.songs.forms.songselectform import SongSelectForm, SearchWorker
|
from openlp.plugins.songs.forms.songselectform import SongSelectForm, SearchWorker
|
||||||
from openlp.plugins.songs.lib import Song
|
from openlp.plugins.songs.lib import Song
|
||||||
from openlp.plugins.songs.lib.songselect import SongSelectImport, LOGOUT_URL, BASE_URL
|
from openlp.plugins.songs.lib.songselect import SongSelectImport, LOGOUT_URL, BASE_URL
|
||||||
|
|
||||||
from tests.helpers.songfileimport import SongImportTestHelper
|
from tests.helpers.songfileimport import SongImportTestHelper
|
||||||
from tests.helpers.testmixin import TestMixin
|
from tests.helpers.testmixin import TestMixin
|
||||||
from tests.utils.constants import RESOURCE_PATH
|
from tests.utils.constants import RESOURCE_PATH
|
||||||
|
@ -27,7 +27,6 @@ from unittest.mock import patch, MagicMock
|
|||||||
|
|
||||||
from openlp.plugins.songs.lib import VerseType
|
from openlp.plugins.songs.lib import VerseType
|
||||||
from openlp.plugins.songs.lib.importers.songshowplus import SongShowPlusImport
|
from openlp.plugins.songs.lib.importers.songshowplus import SongShowPlusImport
|
||||||
|
|
||||||
from tests.helpers.songfileimport import SongImportTestHelper
|
from tests.helpers.songfileimport import SongImportTestHelper
|
||||||
from tests.utils.constants import RESOURCE_PATH
|
from tests.utils.constants import RESOURCE_PATH
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@ from unittest.mock import MagicMock, patch
|
|||||||
from openlp.core.common.registry import Registry
|
from openlp.core.common.registry import Registry
|
||||||
from openlp.plugins.songs.lib.importers.songimport import SongImport
|
from openlp.plugins.songs.lib.importers.songimport import SongImport
|
||||||
from openlp.plugins.songs.lib.importers.zionworx import ZionWorxImport
|
from openlp.plugins.songs.lib.importers.zionworx import ZionWorxImport
|
||||||
|
|
||||||
from tests.helpers.songfileimport import SongImportTestHelper
|
from tests.helpers.songfileimport import SongImportTestHelper
|
||||||
from tests.utils.constants import RESOURCE_PATH
|
from tests.utils.constants import RESOURCE_PATH
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ import os
|
|||||||
from tempfile import mkstemp
|
from tempfile import mkstemp
|
||||||
|
|
||||||
from PyQt5 import QtCore, QtWidgets
|
from PyQt5 import QtCore, QtWidgets
|
||||||
|
|
||||||
from openlp.core.common.settings import Settings
|
from openlp.core.common.settings import Settings
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,9 +23,6 @@
|
|||||||
The :mod:`tests.resources.projector.data file contains test data
|
The :mod:`tests.resources.projector.data file contains test data
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
|
||||||
from tempfile import gettempdir
|
|
||||||
|
|
||||||
# Test data
|
# Test data
|
||||||
TEST_DB_PJLINK1 = 'projector_pjlink1.sqlite'
|
TEST_DB_PJLINK1 = 'projector_pjlink1.sqlite'
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
|
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
|
||||||
|
|
||||||
|
import json
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# OpenLP - Open Source Lyrics Projection #
|
# OpenLP - Open Source Lyrics Projection #
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
@ -20,7 +21,6 @@
|
|||||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||||
###############################################################################
|
###############################################################################
|
||||||
import os
|
import os
|
||||||
import json
|
|
||||||
|
|
||||||
|
|
||||||
def assert_length(expected, iterable, msg=None):
|
def assert_length(expected, iterable, msg=None):
|
||||||
|
@ -23,8 +23,8 @@
|
|||||||
The :mod:`osdinteraction` provides miscellaneous functions for interacting with
|
The :mod:`osdinteraction` provides miscellaneous functions for interacting with
|
||||||
OSD files.
|
OSD files.
|
||||||
"""
|
"""
|
||||||
import os
|
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
from tests.utils.constants import TEST_RESOURCES_PATH
|
from tests.utils.constants import TEST_RESOURCES_PATH
|
||||||
|
|
||||||
|
@ -23,9 +23,8 @@
|
|||||||
Package to test for proper bzr tags.
|
Package to test for proper bzr tags.
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
from unittest import TestCase
|
|
||||||
|
|
||||||
from subprocess import Popen, PIPE
|
from subprocess import Popen, PIPE
|
||||||
|
from unittest import TestCase
|
||||||
|
|
||||||
TAGS1 = {'1.9.0', '1.9.1', '1.9.2', '1.9.3', '1.9.4', '1.9.5', '1.9.6', '1.9.7', '1.9.8', '1.9.9', '1.9.10',
|
TAGS1 = {'1.9.0', '1.9.1', '1.9.2', '1.9.3', '1.9.4', '1.9.5', '1.9.6', '1.9.7', '1.9.8', '1.9.9', '1.9.10',
|
||||||
'1.9.11', '1.9.12', '2.0', '2.1.0', '2.1.1', '2.1.2', '2.1.3', '2.1.4', '2.1.5', '2.1.6', '2.2',
|
'1.9.11', '1.9.12', '2.0', '2.1.0', '2.1.1', '2.1.2', '2.1.3', '2.1.4', '2.1.5', '2.1.6', '2.2',
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
"""
|
"""
|
||||||
Package to test for proper bzr tags.
|
Package to test for proper bzr tags.
|
||||||
"""
|
"""
|
||||||
import os
|
|
||||||
import platform
|
import platform
|
||||||
import sys
|
import sys
|
||||||
from unittest import TestCase, SkipTest
|
from unittest import TestCase, SkipTest
|
||||||
|
Loading…
Reference in New Issue
Block a user