From cfc487d623bea69d38d0536307e9d1c7abbda47a Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Thu, 28 Dec 2017 08:27:44 +0000 Subject: [PATCH] tests --- openlp/core/api/__init__.py | 4 ++-- openlp/core/api/deploy.py | 2 +- openlp/core/api/endpoint/controller.py | 6 +++--- openlp/core/api/endpoint/core.py | 3 +-- openlp/core/api/endpoint/remote.py | 3 +-- openlp/core/api/endpoint/service.py | 3 +-- openlp/core/api/http/__init__.py | 3 ++- openlp/core/api/http/server.py | 6 +++--- openlp/core/api/http/wsgiapp.py | 3 +-- openlp/core/api/websockets.py | 2 +- openlp/core/app.py | 3 +-- openlp/core/common/__init__.py | 2 +- openlp/core/common/actions.py | 1 - openlp/core/common/db.py | 1 - openlp/core/common/mixins.py | 2 +- openlp/core/common/settings.py | 2 +- openlp/core/display/renderer.py | 4 ++-- openlp/core/display/screens.py | 4 ++-- openlp/core/lib/__init__.py | 2 +- openlp/core/lib/formattingtags.py | 2 +- openlp/core/lib/htmlbuilder.py | 2 +- openlp/core/lib/imagemanager.py | 2 +- openlp/core/lib/mediamanageritem.py | 2 +- openlp/core/lib/serviceitem.py | 2 +- openlp/core/lib/ui.py | 1 - openlp/core/projectors/editform.py | 2 +- openlp/core/projectors/manager.py | 2 +- openlp/core/projectors/sourceselectform.py | 2 +- openlp/core/ui/aboutform.py | 2 +- openlp/core/ui/firsttimeform.py | 8 ++++---- openlp/core/ui/formattingtagform.py | 2 +- openlp/core/ui/mainwindow.py | 11 ++++------- openlp/core/ui/media/endpoint.py | 2 +- openlp/core/ui/media/mediacontroller.py | 12 ++++++------ openlp/core/ui/media/systemplayer.py | 1 - openlp/core/ui/media/vendor/vlc.py | 5 ++--- openlp/core/ui/media/vlcplayer.py | 9 +++++---- openlp/core/ui/media/webkitplayer.py | 2 +- openlp/core/ui/printserviceform.py | 2 +- openlp/core/ui/slidecontroller.py | 1 - openlp/core/ui/style.py | 2 +- openlp/core/widgets/dialogs.py | 2 +- tests/functional/openlp_core/api/http/test_http.py | 2 +- .../functional/openlp_core/api/http/test_wsgiapp.py | 3 +-- .../openlp_core/ui/media/test_mediacontroller.py | 3 +-- .../openlp_core/ui/media/test_vlcplayer.py | 1 - .../openlp_plugins/bibles/test_opensongimport.py | 3 +-- .../openlp_plugins/bibles/test_wordprojectimport.py | 1 - .../openlp_plugins/custom/test_mediaitem.py | 1 - .../openlp_plugins/images/test_imagetab.py | 1 - tests/functional/openlp_plugins/images/test_lib.py | 2 +- .../functional/openlp_plugins/images/test_upgrade.py | 1 - .../presentations/test_impresscontroller.py | 9 ++++----- .../openlp_plugins/presentations/test_mediaitem.py | 3 +-- .../presentations/test_messagelistener.py | 1 - .../presentations/test_pdfcontroller.py | 8 +++----- .../presentations/test_powerpointcontroller.py | 3 +-- .../presentations/test_pptviewcontroller.py | 3 +-- tests/interfaces/openlp_core/common/test_utils.py | 2 +- .../interfaces/openlp_core/lib/test_pluginmanager.py | 5 ++--- .../ui/media/vendor/test_mediainfoWrapper.py | 1 - .../openlp_core/ui/test_filerenamedialog.py | 1 - tests/interfaces/openlp_core/ui/test_mainwindow.py | 1 - .../openlp_core/ui/test_projectoreditform.py | 4 +--- .../openlp_core/ui/test_projectormanager.py | 1 - .../openlp_core/ui/test_projectorsourceform.py | 3 +-- .../interfaces/openlp_core/ui/test_servicemanager.py | 1 - .../openlp_core/ui/test_servicenotedialog.py | 1 - .../interfaces/openlp_core/ui/test_settings_form.py | 3 +-- .../openlp_core/ui/test_shortcutlistform.py | 1 - .../openlp_core/ui/test_starttimedialog.py | 1 - tests/interfaces/openlp_core/ui/test_thememanager.py | 3 +-- tests/interfaces/openlp_core/widgets/test_edits.py | 1 - tests/interfaces/openlp_core/widgets/test_views.py | 3 +-- .../bibles/forms/test_bibleimportform.py | 3 +-- .../openlp_plugins/bibles/test_lib_manager.py | 3 +-- .../bibles/test_lib_parse_reference.py | 3 +-- .../openlp_plugins/custom/forms/test_customform.py | 2 -- .../custom/forms/test_customslideform.py | 1 - .../openlp_plugins/songs/forms/test_editsongform.py | 1 - .../songs/forms/test_songmaintenanceform.py | 1 - 81 files changed, 87 insertions(+), 138 deletions(-) diff --git a/openlp/core/api/__init__.py b/openlp/core/api/__init__.py index 015f0cec3..3587cd651 100644 --- a/openlp/core/api/__init__.py +++ b/openlp/core/api/__init__.py @@ -20,9 +20,9 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -from openlp.core.api.http.endpoint import Endpoint from openlp.core.api.http import register_endpoint, requires_auth -from openlp.core.api.tab import ApiTab +from openlp.core.api.http.endpoint import Endpoint from openlp.core.api.poll import Poller +from openlp.core.api.tab import ApiTab __all__ = ['Endpoint', 'ApiTab', 'register_endpoint', 'requires_auth'] diff --git a/openlp/core/api/deploy.py b/openlp/core/api/deploy.py index a42f83f0c..020f7b3f9 100644 --- a/openlp/core/api/deploy.py +++ b/openlp/core/api/deploy.py @@ -25,8 +25,8 @@ Download and "install" the remote web client from zipfile import ZipFile from openlp.core.common.applocation import AppLocation -from openlp.core.common.registry import Registry from openlp.core.common.httputils import url_get_file, get_web_page, get_url_file_size +from openlp.core.common.registry import Registry def deploy_zipfile(app_root_path, zip_name): diff --git a/openlp/core/api/endpoint/controller.py b/openlp/core/api/endpoint/controller.py index 13e8d1681..4a4c0c667 100644 --- a/openlp/core/api/endpoint/controller.py +++ b/openlp/core/api/endpoint/controller.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 +import json ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # @@ -21,12 +22,11 @@ ############################################################################### import logging import os -import urllib.request import urllib.error -import json +import urllib.request -from openlp.core.api.http.endpoint import Endpoint from openlp.core.api.http import requires_auth +from openlp.core.api.http.endpoint import Endpoint from openlp.core.common.applocation import AppLocation from openlp.core.common.path import Path from openlp.core.common.registry import Registry diff --git a/openlp/core/api/endpoint/core.py b/openlp/core/api/endpoint/core.py index 8b9bcc4c0..a57e80e16 100644 --- a/openlp/core/api/endpoint/core.py +++ b/openlp/core/api/endpoint/core.py @@ -27,11 +27,10 @@ import os from openlp.core.api.http import requires_auth from openlp.core.api.http.endpoint import Endpoint -from openlp.core.common.registry import Registry from openlp.core.common.i18n import UiStrings, translate +from openlp.core.common.registry import Registry from openlp.core.lib import PluginStatus, StringContent, image_to_byte - template_dir = 'templates' static_dir = 'static' blank_dir = os.path.join(static_dir, 'index') diff --git a/openlp/core/api/endpoint/remote.py b/openlp/core/api/endpoint/remote.py index 3a408f74e..8f5d987d7 100644 --- a/openlp/core/api/endpoint/remote.py +++ b/openlp/core/api/endpoint/remote.py @@ -21,9 +21,8 @@ ############################################################################### import logging -from openlp.core.api.http.endpoint import Endpoint from openlp.core.api.endpoint.core import TRANSLATED_STRINGS - +from openlp.core.api.http.endpoint import Endpoint log = logging.getLogger(__name__) diff --git a/openlp/core/api/endpoint/service.py b/openlp/core/api/endpoint/service.py index ab9ae6740..60fee8579 100644 --- a/openlp/core/api/endpoint/service.py +++ b/openlp/core/api/endpoint/service.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 +import json ############################################################################### # OpenLP - Open Source Lyrics Projection # # --------------------------------------------------------------------------- # @@ -20,13 +21,11 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### import logging -import json from openlp.core.api.http import requires_auth from openlp.core.api.http.endpoint import Endpoint from openlp.core.common.registry import Registry - log = logging.getLogger(__name__) service_endpoint = Endpoint('service') diff --git a/openlp/core/api/http/__init__.py b/openlp/core/api/http/__init__.py index 8ff08b1e7..29375a874 100644 --- a/openlp/core/api/http/__init__.py +++ b/openlp/core/api/http/__init__.py @@ -22,10 +22,11 @@ import base64 from functools import wraps + from webob import Response -from openlp.core.common.settings import Settings from openlp.core.api.http.wsgiapp import WSGIApplication +from openlp.core.common.settings import Settings from .errors import NotFound, ServerError, HttpError application = WSGIApplication('api') diff --git a/openlp/core/api/http/server.py b/openlp/core/api/http/server.py index c80275801..b25df5fe9 100644 --- a/openlp/core/api/http/server.py +++ b/openlp/core/api/http/server.py @@ -32,18 +32,18 @@ from waitress import serve from openlp.core.api.deploy import download_and_check, download_sha256 from openlp.core.api.endpoint.controller import controller_endpoint, api_controller_endpoint from openlp.core.api.endpoint.core import chords_endpoint, stage_endpoint, blank_endpoint, main_endpoint -from openlp.core.api.endpoint.service import service_endpoint, api_service_endpoint from openlp.core.api.endpoint.remote import remote_endpoint -from openlp.core.api.http import register_endpoint +from openlp.core.api.endpoint.service import service_endpoint, api_service_endpoint from openlp.core.api.http import application +from openlp.core.api.http import register_endpoint from openlp.core.api.poll import Poller from openlp.core.common.applocation import AppLocation from openlp.core.common.i18n import UiStrings +from openlp.core.common.i18n import translate from openlp.core.common.mixins import LogMixin, RegistryProperties from openlp.core.common.path import create_paths from openlp.core.common.registry import Registry, RegistryBase from openlp.core.common.settings import Settings -from openlp.core.common.i18n import translate log = logging.getLogger(__name__) diff --git a/openlp/core/api/http/wsgiapp.py b/openlp/core/api/http/wsgiapp.py index 4c863b7cb..6a5e31591 100644 --- a/openlp/core/api/http/wsgiapp.py +++ b/openlp/core/api/http/wsgiapp.py @@ -30,9 +30,8 @@ import re from webob import Request, Response from webob.static import DirectoryApp -from openlp.core.common.applocation import AppLocation from openlp.core.api.http.errors import HttpError, NotFound, ServerError - +from openlp.core.common.applocation import AppLocation ARGS_REGEX = re.compile(r'''\{(\w+)(?::([^}]+))?\}''', re.VERBOSE) diff --git a/openlp/core/api/websockets.py b/openlp/core/api/websockets.py index 3417eb74d..6f2235043 100644 --- a/openlp/core/api/websockets.py +++ b/openlp/core/api/websockets.py @@ -24,11 +24,11 @@ The :mod:`http` module contains the API web server. This is a lightweight web se with OpenLP. It uses JSON to communicate with the remotes. """ import asyncio -import websockets import json import logging import time +import websockets from PyQt5 import QtCore from openlp.core.common.mixins import LogMixin, RegistryProperties diff --git a/openlp/core/app.py b/openlp/core/app.py index 114a62807..458eaaf14 100644 --- a/openlp/core/app.py +++ b/openlp/core/app.py @@ -42,7 +42,6 @@ from openlp.core.common.mixins import LogMixin from openlp.core.common.path import create_paths, copytree from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings -from openlp.core.version import check_for_update, get_version from openlp.core.display.screens import ScreenList from openlp.core.resources import qInitResources from openlp.core.ui import SplashScreen @@ -51,7 +50,7 @@ from openlp.core.ui.firsttimeform import FirstTimeForm from openlp.core.ui.firsttimelanguageform import FirstTimeLanguageForm from openlp.core.ui.mainwindow import MainWindow from openlp.core.ui.style import get_application_stylesheet - +from openlp.core.version import check_for_update, get_version __all__ = ['OpenLP', 'main'] diff --git a/openlp/core/common/__init__.py b/openlp/core/common/__init__.py index b6d759f42..83734d4de 100644 --- a/openlp/core/common/__init__.py +++ b/openlp/core/common/__init__.py @@ -30,13 +30,13 @@ import os import re import sys import traceback -from chardet.universaldetector import UniversalDetector from ipaddress import IPv4Address, IPv6Address, AddressValueError from shutil import which from subprocess import check_output, CalledProcessError, STDOUT from PyQt5 import QtGui from PyQt5.QtCore import QCryptographicHash as QHash +from chardet.universaldetector import UniversalDetector log = logging.getLogger(__name__ + '.__init__') diff --git a/openlp/core/common/actions.py b/openlp/core/common/actions.py index a5b417017..ed66c4e3d 100644 --- a/openlp/core/common/actions.py +++ b/openlp/core/common/actions.py @@ -29,7 +29,6 @@ from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common.settings import Settings - log = logging.getLogger(__name__) diff --git a/openlp/core/common/db.py b/openlp/core/common/db.py index a88577932..987876e0c 100644 --- a/openlp/core/common/db.py +++ b/openlp/core/common/db.py @@ -27,7 +27,6 @@ from copy import deepcopy import sqlalchemy - log = logging.getLogger(__name__) diff --git a/openlp/core/common/mixins.py b/openlp/core/common/mixins.py index a07940e10..64a44068a 100644 --- a/openlp/core/common/mixins.py +++ b/openlp/core/common/mixins.py @@ -22,8 +22,8 @@ """ Provide Error Handling and login Services """ -import logging import inspect +import logging from openlp.core.common import is_win, trace_error_handler from openlp.core.common.registry import Registry diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 54f1d9b2a..01707965d 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -23,8 +23,8 @@ This class contains the core default settings. """ import datetime -import logging import json +import logging import os from tempfile import gettempdir diff --git a/openlp/core/display/renderer.py b/openlp/core/display/renderer.py index 836e5edea..33d1bec05 100644 --- a/openlp/core/display/renderer.py +++ b/openlp/core/display/renderer.py @@ -21,10 +21,11 @@ ############################################################################### import re - from string import Template + from PyQt5 import QtGui, QtCore, QtWebKitWidgets +from openlp.core.common import ThemeLevel from openlp.core.common.mixins import LogMixin, RegistryProperties from openlp.core.common.path import path_to_str from openlp.core.common.registry import Registry, RegistryBase @@ -32,7 +33,6 @@ from openlp.core.common.settings import Settings from openlp.core.display.screens import ScreenList from openlp.core.lib import FormattingTags, ImageSource, ItemCapabilities, ServiceItem, expand_tags, build_chords_css, \ build_lyrics_format_css, build_lyrics_outline_css -from openlp.core.common import ThemeLevel from openlp.core.ui.maindisplay import MainDisplay VERSE = 'The Lord said to {r}Noah{/r}: \n' \ diff --git a/openlp/core/display/screens.py b/openlp/core/display/screens.py index 0a1a4cd28..d3202deca 100644 --- a/openlp/core/display/screens.py +++ b/openlp/core/display/screens.py @@ -23,14 +23,14 @@ The :mod:`screen` module provides management functionality for a machines' displays. """ -import logging import copy +import logging from PyQt5 import QtCore +from openlp.core.common.i18n import translate from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings -from openlp.core.common.i18n import translate log = logging.getLogger(__name__) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index b2e1efd32..476076b52 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -25,8 +25,8 @@ OpenLP work. """ import html import logging -import re import math +import re from PyQt5 import QtCore, QtGui, QtWidgets diff --git a/openlp/core/lib/formattingtags.py b/openlp/core/lib/formattingtags.py index c364d388e..aeb458b27 100644 --- a/openlp/core/lib/formattingtags.py +++ b/openlp/core/lib/formattingtags.py @@ -24,8 +24,8 @@ Provide HTML Tag management and Formatting Tag access class """ import json -from openlp.core.common.settings import Settings from openlp.core.common.i18n import translate +from openlp.core.common.settings import Settings class FormattingTags(object): diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index 0330f10c8..4b5b075ad 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -407,8 +407,8 @@ is the function which has to be called from outside. The generated and returned """ import logging - from string import Template + from PyQt5 import QtWebKit from openlp.core.common.settings import Settings diff --git a/openlp/core/lib/imagemanager.py b/openlp/core/lib/imagemanager.py index 81a1b659d..e5318ac9d 100644 --- a/openlp/core/lib/imagemanager.py +++ b/openlp/core/lib/imagemanager.py @@ -26,8 +26,8 @@ wait for the conversion to happen. """ import logging import os -import time import queue +import time from PyQt5 import QtCore diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 38ce3a76c..433b3445f 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -28,8 +28,8 @@ import re from PyQt5 import QtCore, QtWidgets from openlp.core.common.i18n import UiStrings, translate -from openlp.core.common.path import path_to_str, str_to_path from openlp.core.common.mixins import RegistryProperties +from openlp.core.common.path import path_to_str, str_to_path from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.core.lib import ServiceItem, StringContent, ServiceItemContext diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 3a824d424..29970f02e 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -26,9 +26,9 @@ type and capability of an item. import datetime import html import logging +import ntpath import os import uuid -import ntpath from PyQt5 import QtGui diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index 0d5b3c0bd..63256f7bc 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -32,7 +32,6 @@ from openlp.core.common.i18n import UiStrings, translate from openlp.core.common.registry import Registry from openlp.core.lib import build_icon - log = logging.getLogger(__name__) diff --git a/openlp/core/projectors/editform.py b/openlp/core/projectors/editform.py index 4ae1f96d9..c5058a1e0 100644 --- a/openlp/core/projectors/editform.py +++ b/openlp/core/projectors/editform.py @@ -30,8 +30,8 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common import verify_ip_address from openlp.core.common.i18n import translate from openlp.core.lib import build_icon -from openlp.core.projectors.db import Projector from openlp.core.projectors.constants import PJLINK_PORT +from openlp.core.projectors.db import Projector log = logging.getLogger(__name__) log.debug('editform loaded') diff --git a/openlp/core/projectors/manager.py b/openlp/core/projectors/manager.py index b352858b1..cf8e8d4b4 100644 --- a/openlp/core/projectors/manager.py +++ b/openlp/core/projectors/manager.py @@ -39,8 +39,8 @@ from openlp.core.projectors.constants import ERROR_MSG, ERROR_STRING, E_AUTHENTI E_NETWORK, E_NOT_CONNECTED, E_UNKNOWN_SOCKET_ERROR, STATUS_STRING, S_CONNECTED, S_CONNECTING, S_COOLDOWN, \ S_INITIALIZE, S_NOT_CONNECTED, S_OFF, S_ON, S_STANDBY, S_WARMUP from openlp.core.projectors.db import ProjectorDB -from openlp.core.projectors.pjlink import PJLink, PJLinkUDP from openlp.core.projectors.editform import ProjectorEditForm +from openlp.core.projectors.pjlink import PJLink, PJLinkUDP from openlp.core.projectors.sourceselectform import SourceSelectTabs, SourceSelectSingle from openlp.core.widgets.toolbar import OpenLPToolbar diff --git a/openlp/core/projectors/sourceselectform.py b/openlp/core/projectors/sourceselectform.py index aaf8170ac..60cce5b76 100644 --- a/openlp/core/projectors/sourceselectform.py +++ b/openlp/core/projectors/sourceselectform.py @@ -31,8 +31,8 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common import is_macosx from openlp.core.common.i18n import translate from openlp.core.lib import build_icon -from openlp.core.projectors.db import ProjectorSource from openlp.core.projectors.constants import PJLINK_DEFAULT_SOURCES, PJLINK_DEFAULT_CODES +from openlp.core.projectors.db import ProjectorSource log = logging.getLogger(__name__) diff --git a/openlp/core/ui/aboutform.py b/openlp/core/ui/aboutform.py index e2b4eca87..ec58b86b9 100644 --- a/openlp/core/ui/aboutform.py +++ b/openlp/core/ui/aboutform.py @@ -26,8 +26,8 @@ import webbrowser from PyQt5 import QtCore, QtWidgets -from openlp.core.version import get_version from openlp.core.common.i18n import translate +from openlp.core.version import get_version from .aboutdialog import UiAboutDialog diff --git a/openlp/core/ui/firsttimeform.py b/openlp/core/ui/firsttimeform.py index 597efad02..7d9ce7a4a 100644 --- a/openlp/core/ui/firsttimeform.py +++ b/openlp/core/ui/firsttimeform.py @@ -26,9 +26,9 @@ import logging import os import socket import time -import urllib.request -import urllib.parse import urllib.error +import urllib.parse +import urllib.request from configparser import ConfigParser, MissingSectionHeaderError, NoOptionError, NoSectionError from tempfile import gettempdir @@ -36,14 +36,14 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common import clean_button_text, trace_error_handler from openlp.core.common.applocation import AppLocation +from openlp.core.common.httputils import get_web_page, get_url_file_size, url_get_file, CONNECTION_TIMEOUT from openlp.core.common.i18n import translate -from openlp.core.common.path import Path, create_paths from openlp.core.common.mixins import RegistryProperties +from openlp.core.common.path import Path, create_paths from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.core.lib import PluginStatus, build_icon from openlp.core.lib.ui import critical_error_message_box -from openlp.core.common.httputils import get_web_page, get_url_file_size, url_get_file, CONNECTION_TIMEOUT from .firsttimewizard import UiFirstTimeWizard, FirstTimePage log = logging.getLogger(__name__) diff --git a/openlp/core/ui/formattingtagform.py b/openlp/core/ui/formattingtagform.py index ab0bfc79f..2e24e6047 100644 --- a/openlp/core/ui/formattingtagform.py +++ b/openlp/core/ui/formattingtagform.py @@ -28,8 +28,8 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common.i18n import translate from openlp.core.lib import FormattingTags -from openlp.core.ui.formattingtagdialog import Ui_FormattingTagDialog from openlp.core.ui.formattingtagcontroller import FormattingTagController +from openlp.core.ui.formattingtagdialog import Ui_FormattingTagDialog class EditColumn(object): diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index ee07cbd69..3e392a1b6 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -23,8 +23,6 @@ This is the main window, where all the action happens. """ import logging -import os -import shutil import sys import time from datetime import datetime @@ -40,25 +38,24 @@ from openlp.core.common import is_win, is_macosx, add_actions from openlp.core.common.actions import ActionList, CategoryOrder from openlp.core.common.applocation import AppLocation from openlp.core.common.i18n import LanguageManager, UiStrings, translate -from openlp.core.common.path import Path, copyfile, create_paths from openlp.core.common.mixins import RegistryProperties +from openlp.core.common.path import Path, copyfile, create_paths from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings -from openlp.core.display.screens import ScreenList from openlp.core.display.renderer import Renderer +from openlp.core.display.screens import ScreenList from openlp.core.lib import PluginManager, ImageManager, PluginStatus, build_icon from openlp.core.lib.ui import create_action from openlp.core.projectors.manager import ProjectorManager from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, ThemeManager, LiveController, PluginForm, \ ShortcutListForm, FormattingTagForm, PreviewController from openlp.core.ui.firsttimeform import FirstTimeForm -from openlp.core.widgets.dialogs import FileDialog -from openlp.core.widgets.docks import OpenLPDockWidget, MediaDockManager from openlp.core.ui.media import MediaController from openlp.core.ui.printserviceform import PrintServiceForm from openlp.core.ui.style import PROGRESSBAR_STYLE, get_library_stylesheet from openlp.core.version import get_version - +from openlp.core.widgets.dialogs import FileDialog +from openlp.core.widgets.docks import OpenLPDockWidget, MediaDockManager log = logging.getLogger(__name__) diff --git a/openlp/core/ui/media/endpoint.py b/openlp/core/ui/media/endpoint.py index af7623003..05ac25925 100644 --- a/openlp/core/ui/media/endpoint.py +++ b/openlp/core/ui/media/endpoint.py @@ -24,8 +24,8 @@ The :mod:`~openlp.core.api.endpoint` module contains various API endpoints """ import logging -from openlp.core.api.http.endpoint import Endpoint from openlp.core.api.http import requires_auth +from openlp.core.api.http.endpoint import Endpoint from openlp.core.common.registry import Registry log = logging.getLogger(__name__) diff --git a/openlp/core/ui/media/mediacontroller.py b/openlp/core/ui/media/mediacontroller.py index 87d3a3063..fcaadbef7 100644 --- a/openlp/core/ui/media/mediacontroller.py +++ b/openlp/core/ui/media/mediacontroller.py @@ -23,9 +23,10 @@ The :mod:`~openlp.core.ui.media.mediacontroller` module contains a base class for media components and other widgets related to playing media, such as sliders. """ +import datetime import logging import os -import datetime + from PyQt5 import QtCore, QtWidgets from openlp.core.api.http import register_endpoint @@ -37,14 +38,13 @@ from openlp.core.common.settings import Settings from openlp.core.lib import ItemCapabilities from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui import DisplayControllerType -from openlp.core.ui.media.endpoint import media_endpoint -from openlp.core.ui.media.vendor.mediainfoWrapper import MediaInfoWrapper -from openlp.core.ui.media.mediaplayer import MediaPlayer -from openlp.core.ui.media import MediaState, MediaInfo, MediaType, get_media_players, set_media_players,\ +from openlp.core.ui.media import MediaState, MediaInfo, MediaType, get_media_players, set_media_players, \ parse_optical_path +from openlp.core.ui.media.endpoint import media_endpoint +from openlp.core.ui.media.mediaplayer import MediaPlayer +from openlp.core.ui.media.vendor.mediainfoWrapper import MediaInfoWrapper from openlp.core.widgets.toolbar import OpenLPToolbar - log = logging.getLogger(__name__) TICK_TIME = 200 diff --git a/openlp/core/ui/media/systemplayer.py b/openlp/core/ui/media/systemplayer.py index a6423db02..87e4f4e76 100644 --- a/openlp/core/ui/media/systemplayer.py +++ b/openlp/core/ui/media/systemplayer.py @@ -32,7 +32,6 @@ from openlp.core.common.i18n import translate from openlp.core.ui.media import MediaState from openlp.core.ui.media.mediaplayer import MediaPlayer - log = logging.getLogger(__name__) ADDITIONAL_EXT = { diff --git a/openlp/core/ui/media/vendor/vlc.py b/openlp/core/ui/media/vendor/vlc.py index 7383621b0..b7c7cfdce 100644 --- a/openlp/core/ui/media/vendor/vlc.py +++ b/openlp/core/ui/media/vendor/vlc.py @@ -40,11 +40,10 @@ C{get_instance} method of L{MediaPlayer} and L{MediaListPlayer}. """ import ctypes -from ctypes.util import find_library +import functools import os import sys -import functools - +from ctypes.util import find_library # Used by EventManager in override.py from inspect import getargspec diff --git a/openlp/core/ui/media/vlcplayer.py b/openlp/core/ui/media/vlcplayer.py index 840471cfe..d5300040c 100644 --- a/openlp/core/ui/media/vlcplayer.py +++ b/openlp/core/ui/media/vlcplayer.py @@ -22,13 +22,14 @@ """ The :mod:`~openlp.core.ui.media.vlcplayer` module contains our VLC component wrapper """ -from datetime import datetime -from distutils.version import LooseVersion +import ctypes import logging import os -import threading import sys -import ctypes +import threading +from datetime import datetime +from distutils.version import LooseVersion + from PyQt5 import QtWidgets from openlp.core.common import is_win, is_macosx, is_linux diff --git a/openlp/core/ui/media/webkitplayer.py b/openlp/core/ui/media/webkitplayer.py index e9142463e..9b6666d01 100644 --- a/openlp/core/ui/media/webkitplayer.py +++ b/openlp/core/ui/media/webkitplayer.py @@ -26,8 +26,8 @@ import logging from PyQt5 import QtGui, QtWebKitWidgets -from openlp.core.common.settings import Settings from openlp.core.common.i18n import translate +from openlp.core.common.settings import Settings from openlp.core.ui.media import MediaState from openlp.core.ui.media.mediaplayer import MediaPlayer diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index 07ab24496..6fb7fbe3e 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -24,8 +24,8 @@ The actual print service dialog """ import datetime import html -import lxml.html +import lxml.html from PyQt5 import QtCore, QtGui, QtWidgets, QtPrintSupport from openlp.core.common.applocation import AppLocation diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 5b9872082..801afa9db 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -42,7 +42,6 @@ from openlp.core.ui import HideMode, MainDisplay, Display, DisplayControllerType from openlp.core.widgets.toolbar import OpenLPToolbar from openlp.core.widgets.views import ListPreviewWidget - # Threshold which has to be trespassed to toggle. HIDE_MENU_THRESHOLD = 27 AUDIO_TIME_LABEL_STYLESHEET = 'background-color: palette(background); ' \ diff --git a/openlp/core/ui/style.py b/openlp/core/ui/style.py index 764a3bd26..516d3eea1 100644 --- a/openlp/core/ui/style.py +++ b/openlp/core/ui/style.py @@ -24,7 +24,7 @@ The :mod:`~openlp.core.ui.dark` module looks for and loads a dark theme """ from PyQt5 import QtGui -from openlp.core.common import is_macosx, is_win +from openlp.core.common import is_win from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings diff --git a/openlp/core/widgets/dialogs.py b/openlp/core/widgets/dialogs.py index f1c2bcc24..d0a8e46f5 100755 --- a/openlp/core/widgets/dialogs.py +++ b/openlp/core/widgets/dialogs.py @@ -22,7 +22,7 @@ """ Patch the QFileDialog so it accepts and returns Path objects""" from PyQt5 import QtWidgets -from openlp.core.common.path import Path, path_to_str, replace_params, str_to_path +from openlp.core.common.path import path_to_str, replace_params, str_to_path class FileDialog(QtWidgets.QFileDialog): diff --git a/tests/functional/openlp_core/api/http/test_http.py b/tests/functional/openlp_core/api/http/test_http.py index 7dd8418ae..71ecd207f 100644 --- a/tests/functional/openlp_core/api/http/test_http.py +++ b/tests/functional/openlp_core/api/http/test_http.py @@ -25,8 +25,8 @@ Functional tests to test the Http Server Class. from unittest import TestCase from unittest.mock import MagicMock, patch -from openlp.core.common.registry import Registry from openlp.core.api.http.server import HttpServer +from openlp.core.common.registry import Registry class TestHttpServer(TestCase): diff --git a/tests/functional/openlp_core/api/http/test_wsgiapp.py b/tests/functional/openlp_core/api/http/test_wsgiapp.py index 17b3ae8c5..db720a5f3 100644 --- a/tests/functional/openlp_core/api/http/test_wsgiapp.py +++ b/tests/functional/openlp_core/api/http/test_wsgiapp.py @@ -23,12 +23,11 @@ Functional test the routing code. """ import os - from unittest import TestCase from unittest.mock import MagicMock -from openlp.core.api.http.endpoint import Endpoint from openlp.core.api.http import register_endpoint, application, NotFound +from openlp.core.api.http.endpoint import Endpoint ROOT_DIR = os.path.dirname(os.path.realpath(__file__)) diff --git a/tests/functional/openlp_core/ui/media/test_mediacontroller.py b/tests/functional/openlp_core/ui/media/test_mediacontroller.py index c93b11f33..df2f2656a 100644 --- a/tests/functional/openlp_core/ui/media/test_mediacontroller.py +++ b/tests/functional/openlp_core/ui/media/test_mediacontroller.py @@ -25,10 +25,9 @@ Package to test the openlp.core.ui.media package. from unittest import TestCase from unittest.mock import MagicMock, patch +from openlp.core.common.registry import Registry from openlp.core.ui.media.mediacontroller import MediaController from openlp.core.ui.media.mediaplayer import MediaPlayer -from openlp.core.common.registry import Registry - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/ui/media/test_vlcplayer.py b/tests/functional/openlp_core/ui/media/test_vlcplayer.py index b4c6b8c28..0a7f5d2ac 100644 --- a/tests/functional/openlp_core/ui/media/test_vlcplayer.py +++ b/tests/functional/openlp_core/ui/media/test_vlcplayer.py @@ -31,7 +31,6 @@ from unittest.mock import MagicMock, patch, call from openlp.core.common.registry import Registry from openlp.core.ui.media import MediaState, MediaType from openlp.core.ui.media.vlcplayer import AUDIO_EXT, VIDEO_EXT, VlcPlayer, get_vlc - from tests.helpers import MockDateTime from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_plugins/bibles/test_opensongimport.py b/tests/functional/openlp_plugins/bibles/test_opensongimport.py index 5173b730c..a1b6f4720 100644 --- a/tests/functional/openlp_plugins/bibles/test_opensongimport.py +++ b/tests/functional/openlp_plugins/bibles/test_opensongimport.py @@ -28,9 +28,8 @@ from unittest.mock import MagicMock, patch, call from lxml import objectify from openlp.core.common.registry import Registry -from openlp.plugins.bibles.lib.importers.opensong import OpenSongBible, get_text, parse_chapter_number from openlp.plugins.bibles.lib.bibleimport import BibleImport - +from openlp.plugins.bibles.lib.importers.opensong import OpenSongBible, get_text, parse_chapter_number from tests.helpers.testmixin import TestMixin from tests.utils import load_external_result_data from tests.utils.constants import RESOURCE_PATH diff --git a/tests/functional/openlp_plugins/bibles/test_wordprojectimport.py b/tests/functional/openlp_plugins/bibles/test_wordprojectimport.py index 4f3a1c15a..001fea9cb 100644 --- a/tests/functional/openlp_plugins/bibles/test_wordprojectimport.py +++ b/tests/functional/openlp_plugins/bibles/test_wordprojectimport.py @@ -27,7 +27,6 @@ from unittest.mock import MagicMock, patch, call from openlp.core.common.path import Path from openlp.plugins.bibles.lib.importers.wordproject import WordProjectBible - from tests.utils.constants import RESOURCE_PATH TEST_PATH = RESOURCE_PATH / 'bibles' diff --git a/tests/functional/openlp_plugins/custom/test_mediaitem.py b/tests/functional/openlp_plugins/custom/test_mediaitem.py index 90f4810ef..39d5b167d 100644 --- a/tests/functional/openlp_plugins/custom/test_mediaitem.py +++ b/tests/functional/openlp_plugins/custom/test_mediaitem.py @@ -30,7 +30,6 @@ from PyQt5 import QtCore from openlp.core.common.registry import Registry from openlp.core.lib import ServiceItem, PluginStatus from openlp.plugins.custom.lib import CustomMediaItem - from tests.helpers.testmixin import TestMixin FOOTER = ['Arky Arky (Unknown)', 'Public Domain', 'CCLI 123456'] diff --git a/tests/functional/openlp_plugins/images/test_imagetab.py b/tests/functional/openlp_plugins/images/test_imagetab.py index 329fac0b8..270769e4f 100644 --- a/tests/functional/openlp_plugins/images/test_imagetab.py +++ b/tests/functional/openlp_plugins/images/test_imagetab.py @@ -30,7 +30,6 @@ from PyQt5 import QtWidgets from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.plugins.images.lib import ImageTab - from tests.helpers.testmixin import TestMixin __default_settings__ = { diff --git a/tests/functional/openlp_plugins/images/test_lib.py b/tests/functional/openlp_plugins/images/test_lib.py index 9be64b80a..078d0f613 100644 --- a/tests/functional/openlp_plugins/images/test_lib.py +++ b/tests/functional/openlp_plugins/images/test_lib.py @@ -27,8 +27,8 @@ from unittest.mock import ANY, MagicMock, patch from PyQt5 import QtCore, QtWidgets -from openlp.core.common.registry import Registry from openlp.core.common.path import Path +from openlp.core.common.registry import Registry from openlp.plugins.images.lib.db import ImageFilenames, ImageGroups from openlp.plugins.images.lib.mediaitem import ImageMediaItem diff --git a/tests/functional/openlp_plugins/images/test_upgrade.py b/tests/functional/openlp_plugins/images/test_upgrade.py index b1df7d4c3..5ce1fb10d 100644 --- a/tests/functional/openlp_plugins/images/test_upgrade.py +++ b/tests/functional/openlp_plugins/images/test_upgrade.py @@ -34,7 +34,6 @@ from openlp.core.common.settings import Settings from openlp.core.lib.db import Manager from openlp.plugins.images.lib import upgrade from openlp.plugins.images.lib.db import ImageFilenames, init_schema - from tests.helpers.testmixin import TestMixin from tests.utils.constants import TEST_RESOURCES_PATH diff --git a/tests/functional/openlp_plugins/presentations/test_impresscontroller.py b/tests/functional/openlp_plugins/presentations/test_impresscontroller.py index 9a124921d..852e737e4 100644 --- a/tests/functional/openlp_plugins/presentations/test_impresscontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_impresscontroller.py @@ -22,18 +22,17 @@ """ Functional tests to test the Impress class and related methods. """ -from unittest import TestCase -from unittest.mock import MagicMock, patch import shutil from tempfile import mkdtemp +from unittest import TestCase +from unittest.mock import MagicMock, patch -from openlp.core.common.settings import Settings from openlp.core.common.path import Path +from openlp.core.common.settings import Settings from openlp.plugins.presentations.lib.impresscontroller import ImpressController, ImpressDocument, TextType from openlp.plugins.presentations.presentationplugin import __default_settings__ - -from tests.utils.constants import TEST_RESOURCES_PATH from tests.helpers.testmixin import TestMixin +from tests.utils.constants import TEST_RESOURCES_PATH class TestImpressController(TestCase, TestMixin): diff --git a/tests/functional/openlp_plugins/presentations/test_mediaitem.py b/tests/functional/openlp_plugins/presentations/test_mediaitem.py index e2035d92b..041cf75f7 100644 --- a/tests/functional/openlp_plugins/presentations/test_mediaitem.py +++ b/tests/functional/openlp_plugins/presentations/test_mediaitem.py @@ -25,10 +25,9 @@ This module contains tests for the lib submodule of the Presentations plugin. from unittest import TestCase from unittest.mock import patch, MagicMock, call -from openlp.core.common.registry import Registry from openlp.core.common.path import Path +from openlp.core.common.registry import Registry from openlp.plugins.presentations.lib.mediaitem import PresentationMediaItem - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_plugins/presentations/test_messagelistener.py b/tests/functional/openlp_plugins/presentations/test_messagelistener.py index 56552a46b..ad64cf919 100644 --- a/tests/functional/openlp_plugins/presentations/test_messagelistener.py +++ b/tests/functional/openlp_plugins/presentations/test_messagelistener.py @@ -28,7 +28,6 @@ from unittest.mock import patch, MagicMock from openlp.core.common.registry import Registry from openlp.plugins.presentations.lib.mediaitem import MessageListener, PresentationMediaItem from openlp.plugins.presentations.lib.messagelistener import Controller - from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py b/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py index 12e64334e..b981bd8b2 100644 --- a/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_pdfcontroller.py @@ -23,20 +23,18 @@ This module contains tests for the PdfController """ import os -import shutil from tempfile import mkdtemp from unittest import TestCase, SkipTest from unittest.mock import MagicMock, patch from PyQt5 import QtCore, QtGui -from openlp.plugins.presentations.lib.pdfcontroller import PdfController, PdfDocument -from openlp.core.common.settings import Settings from openlp.core.common.path import Path +from openlp.core.common.settings import Settings from openlp.core.display.screens import ScreenList - -from tests.utils.constants import TEST_RESOURCES_PATH +from openlp.plugins.presentations.lib.pdfcontroller import PdfController, PdfDocument from tests.helpers.testmixin import TestMixin +from tests.utils.constants import TEST_RESOURCES_PATH __default_settings__ = { 'presentations/enable_pdf_program': False, diff --git a/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py b/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py index 6bd16e208..e16878db4 100644 --- a/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py @@ -24,15 +24,14 @@ Functional tests to test the PowerPointController class and related methods. """ import os import shutil +from tempfile import mkdtemp from unittest import TestCase from unittest.mock import patch, MagicMock -from tempfile import mkdtemp from openlp.core.common import is_win from openlp.core.common.settings import Settings from openlp.plugins.presentations.lib.powerpointcontroller import PowerpointController, PowerpointDocument, \ _get_text_from_shapes - from tests.helpers.testmixin import TestMixin from tests.utils.constants import TEST_RESOURCES_PATH diff --git a/tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py b/tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py index 0546b8a93..72d293e3f 100644 --- a/tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py @@ -27,10 +27,9 @@ from tempfile import mkdtemp from unittest import TestCase, skipIf from unittest.mock import MagicMock, patch -from openlp.plugins.presentations.lib.pptviewcontroller import PptviewDocument, PptviewController from openlp.core.common import is_win from openlp.core.common.path import Path - +from openlp.plugins.presentations.lib.pptviewcontroller import PptviewDocument, PptviewController from tests.helpers.testmixin import TestMixin from tests.utils.constants import TEST_RESOURCES_PATH diff --git a/tests/interfaces/openlp_core/common/test_utils.py b/tests/interfaces/openlp_core/common/test_utils.py index 9669e3038..9ff7c3c4e 100644 --- a/tests/interfaces/openlp_core/common/test_utils.py +++ b/tests/interfaces/openlp_core/common/test_utils.py @@ -26,8 +26,8 @@ from unittest import TestCase from openlp.core.common import is_not_image_file from openlp.core.common.path import Path -from tests.utils.constants import TEST_RESOURCES_PATH from tests.helpers.testmixin import TestMixin +from tests.utils.constants import TEST_RESOURCES_PATH class TestUtils(TestCase, TestMixin): diff --git a/tests/interfaces/openlp_core/lib/test_pluginmanager.py b/tests/interfaces/openlp_core/lib/test_pluginmanager.py index ad1fb4194..29efb4631 100644 --- a/tests/interfaces/openlp_core/lib/test_pluginmanager.py +++ b/tests/interfaces/openlp_core/lib/test_pluginmanager.py @@ -22,19 +22,18 @@ """ Package to test the openlp.core.lib.pluginmanager package. """ -import sys import gc +import sys from tempfile import mkdtemp from unittest import TestCase from unittest.mock import MagicMock, patch from PyQt5 import QtWidgets +from openlp.core.common.path import Path from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings -from openlp.core.common.path import Path from openlp.core.lib.pluginmanager import PluginManager - from tests.helpers.testmixin import TestMixin diff --git a/tests/interfaces/openlp_core/ui/media/vendor/test_mediainfoWrapper.py b/tests/interfaces/openlp_core/ui/media/vendor/test_mediainfoWrapper.py index a718f4568..80865c079 100644 --- a/tests/interfaces/openlp_core/ui/media/vendor/test_mediainfoWrapper.py +++ b/tests/interfaces/openlp_core/ui/media/vendor/test_mediainfoWrapper.py @@ -25,7 +25,6 @@ Package to test the openlp.core.ui.media package. from unittest import TestCase from openlp.core.ui.media.vendor.mediainfoWrapper import MediaInfoWrapper - from tests.utils.constants import RESOURCE_PATH TEST_PATH = RESOURCE_PATH / 'media' diff --git a/tests/interfaces/openlp_core/ui/test_filerenamedialog.py b/tests/interfaces/openlp_core/ui/test_filerenamedialog.py index 01483de57..be4698d1e 100644 --- a/tests/interfaces/openlp_core/ui/test_filerenamedialog.py +++ b/tests/interfaces/openlp_core/ui/test_filerenamedialog.py @@ -29,7 +29,6 @@ from PyQt5 import QtTest, QtWidgets from openlp.core.common.registry import Registry from openlp.core.ui import filerenameform - from tests.helpers.testmixin import TestMixin diff --git a/tests/interfaces/openlp_core/ui/test_mainwindow.py b/tests/interfaces/openlp_core/ui/test_mainwindow.py index 4a8ced265..08423785f 100644 --- a/tests/interfaces/openlp_core/ui/test_mainwindow.py +++ b/tests/interfaces/openlp_core/ui/test_mainwindow.py @@ -27,7 +27,6 @@ from unittest.mock import MagicMock, patch from openlp.core.common.registry import Registry from openlp.core.ui.mainwindow import MainWindow - from tests.helpers.testmixin import TestMixin diff --git a/tests/interfaces/openlp_core/ui/test_projectoreditform.py b/tests/interfaces/openlp_core/ui/test_projectoreditform.py index ec2539a29..cfb51b1a1 100644 --- a/tests/interfaces/openlp_core/ui/test_projectoreditform.py +++ b/tests/interfaces/openlp_core/ui/test_projectoreditform.py @@ -30,10 +30,8 @@ from unittest.mock import patch from openlp.core.common.registry import Registry from openlp.core.projectors.db import Projector, ProjectorDB from openlp.core.projectors.editform import ProjectorEditForm -from openlp.core.projectors.manager import ProjectorManager - from tests.helpers.testmixin import TestMixin -from tests.resources.projector.data import TEST_DB, TEST1_DATA, TEST2_DATA +from tests.resources.projector.data import TEST_DB, TEST1_DATA class TestProjectorEditForm(TestCase, TestMixin): diff --git a/tests/interfaces/openlp_core/ui/test_projectormanager.py b/tests/interfaces/openlp_core/ui/test_projectormanager.py index 0cd69d6e0..4c7c21ef6 100644 --- a/tests/interfaces/openlp_core/ui/test_projectormanager.py +++ b/tests/interfaces/openlp_core/ui/test_projectormanager.py @@ -30,7 +30,6 @@ from openlp.core.common.registry import Registry from openlp.core.projectors.db import ProjectorDB from openlp.core.projectors.editform import ProjectorEditForm from openlp.core.projectors.manager import ProjectorManager - from tests.helpers.testmixin import TestMixin from tests.resources.projector.data import TEST_DB diff --git a/tests/interfaces/openlp_core/ui/test_projectorsourceform.py b/tests/interfaces/openlp_core/ui/test_projectorsourceform.py index 25f9a20f8..4b0119fb5 100644 --- a/tests/interfaces/openlp_core/ui/test_projectorsourceform.py +++ b/tests/interfaces/openlp_core/ui/test_projectorsourceform.py @@ -32,10 +32,9 @@ from unittest.mock import patch from PyQt5.QtWidgets import QDialog from openlp.core.common.registry import Registry -from openlp.core.projectors.db import ProjectorDB, Projector from openlp.core.projectors.constants import PJLINK_DEFAULT_CODES, PJLINK_DEFAULT_SOURCES +from openlp.core.projectors.db import ProjectorDB, Projector from openlp.core.projectors.sourceselectform import source_group, SourceSelectSingle - from tests.helpers.testmixin import TestMixin from tests.resources.projector.data import TEST_DB, TEST1_DATA diff --git a/tests/interfaces/openlp_core/ui/test_servicemanager.py b/tests/interfaces/openlp_core/ui/test_servicemanager.py index ebe452d67..6d2296ded 100644 --- a/tests/interfaces/openlp_core/ui/test_servicemanager.py +++ b/tests/interfaces/openlp_core/ui/test_servicemanager.py @@ -30,7 +30,6 @@ from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common.registry import Registry from openlp.core.lib import ServiceItem, ItemCapabilities from openlp.core.ui.servicemanager import ServiceManager - from tests.helpers.testmixin import TestMixin diff --git a/tests/interfaces/openlp_core/ui/test_servicenotedialog.py b/tests/interfaces/openlp_core/ui/test_servicenotedialog.py index bdcbe46e4..38a0efc64 100644 --- a/tests/interfaces/openlp_core/ui/test_servicenotedialog.py +++ b/tests/interfaces/openlp_core/ui/test_servicenotedialog.py @@ -29,7 +29,6 @@ from PyQt5 import QtCore, QtTest, QtWidgets from openlp.core.common.registry import Registry from openlp.core.ui import servicenoteform - from tests.helpers.testmixin import TestMixin diff --git a/tests/interfaces/openlp_core/ui/test_settings_form.py b/tests/interfaces/openlp_core/ui/test_settings_form.py index f4ec5ccbc..8265c7b30 100644 --- a/tests/interfaces/openlp_core/ui/test_settings_form.py +++ b/tests/interfaces/openlp_core/ui/test_settings_form.py @@ -28,9 +28,8 @@ from unittest.mock import MagicMock, patch from PyQt5 import QtCore, QtTest from openlp.core.common.registry import Registry -from openlp.core.ui import settingsform from openlp.core.display.screens import ScreenList - +from openlp.core.ui import settingsform from tests.helpers.testmixin import TestMixin SCREEN = { diff --git a/tests/interfaces/openlp_core/ui/test_shortcutlistform.py b/tests/interfaces/openlp_core/ui/test_shortcutlistform.py index 34589996c..855eb2cb1 100644 --- a/tests/interfaces/openlp_core/ui/test_shortcutlistform.py +++ b/tests/interfaces/openlp_core/ui/test_shortcutlistform.py @@ -29,7 +29,6 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common.registry import Registry from openlp.core.ui.shortcutlistform import ShortcutListForm - from tests.helpers.testmixin import TestMixin diff --git a/tests/interfaces/openlp_core/ui/test_starttimedialog.py b/tests/interfaces/openlp_core/ui/test_starttimedialog.py index b5db55004..05b52609b 100644 --- a/tests/interfaces/openlp_core/ui/test_starttimedialog.py +++ b/tests/interfaces/openlp_core/ui/test_starttimedialog.py @@ -29,7 +29,6 @@ from PyQt5 import QtCore, QtTest, QtWidgets from openlp.core.common.registry import Registry from openlp.core.ui import starttimeform - from tests.helpers.testmixin import TestMixin diff --git a/tests/interfaces/openlp_core/ui/test_thememanager.py b/tests/interfaces/openlp_core/ui/test_thememanager.py index b92a08463..273bb1e2f 100644 --- a/tests/interfaces/openlp_core/ui/test_thememanager.py +++ b/tests/interfaces/openlp_core/ui/test_thememanager.py @@ -25,11 +25,10 @@ Interface tests to test the themeManager class and related methods. from unittest import TestCase from unittest.mock import patch, MagicMock +from openlp.core.common.path import Path from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings -from openlp.core.common.path import Path from openlp.core.ui import ThemeManager - from tests.helpers.testmixin import TestMixin diff --git a/tests/interfaces/openlp_core/widgets/test_edits.py b/tests/interfaces/openlp_core/widgets/test_edits.py index 08906aefe..5f5deba40 100644 --- a/tests/interfaces/openlp_core/widgets/test_edits.py +++ b/tests/interfaces/openlp_core/widgets/test_edits.py @@ -29,7 +29,6 @@ from PyQt5 import QtCore, QtGui, QtTest, QtWidgets from openlp.core.common.registry import Registry from openlp.core.widgets.edits import SearchEdit, HistoryComboBox - from tests.helpers.testmixin import TestMixin diff --git a/tests/interfaces/openlp_core/widgets/test_views.py b/tests/interfaces/openlp_core/widgets/test_views.py index ae9febf25..2ed3c473e 100644 --- a/tests/interfaces/openlp_core/widgets/test_views.py +++ b/tests/interfaces/openlp_core/widgets/test_views.py @@ -30,9 +30,8 @@ from PyQt5 import QtGui, QtWidgets from openlp.core.common.registry import Registry from openlp.core.lib import ServiceItem from openlp.core.widgets.views import ListPreviewWidget - -from tests.utils.osdinteraction import read_service_from_file from tests.helpers.testmixin import TestMixin +from tests.utils.osdinteraction import read_service_from_file class TestListPreviewWidget(TestCase, TestMixin): diff --git a/tests/interfaces/openlp_plugins/bibles/forms/test_bibleimportform.py b/tests/interfaces/openlp_plugins/bibles/forms/test_bibleimportform.py index d32fe1a7e..97a90f0e1 100644 --- a/tests/interfaces/openlp_plugins/bibles/forms/test_bibleimportform.py +++ b/tests/interfaces/openlp_plugins/bibles/forms/test_bibleimportform.py @@ -28,8 +28,7 @@ from unittest.mock import MagicMock, patch from PyQt5 import QtWidgets from openlp.core.common.registry import Registry -from openlp.plugins.bibles.forms.bibleimportform import BibleImportForm, PYSWORD_AVAILABLE - +from openlp.plugins.bibles.forms.bibleimportform import BibleImportForm from tests.helpers.testmixin import TestMixin diff --git a/tests/interfaces/openlp_plugins/bibles/test_lib_manager.py b/tests/interfaces/openlp_plugins/bibles/test_lib_manager.py index da6123a45..1f0fb9482 100644 --- a/tests/interfaces/openlp_plugins/bibles/test_lib_manager.py +++ b/tests/interfaces/openlp_plugins/bibles/test_lib_manager.py @@ -28,9 +28,8 @@ from unittest.mock import MagicMock, patch from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.plugins.bibles.lib import BibleManager, LanguageSelection - -from tests.utils.constants import TEST_RESOURCES_PATH from tests.helpers.testmixin import TestMixin +from tests.utils.constants import TEST_RESOURCES_PATH class TestBibleManager(TestCase, TestMixin): diff --git a/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py b/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py index 12ebe3ad3..545499bbd 100644 --- a/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py +++ b/tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py @@ -28,9 +28,8 @@ from unittest.mock import MagicMock, patch from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.plugins.bibles.lib import BibleManager, parse_reference, LanguageSelection - -from tests.utils.constants import TEST_RESOURCES_PATH from tests.helpers.testmixin import TestMixin +from tests.utils.constants import TEST_RESOURCES_PATH class TestBibleManager(TestCase, TestMixin): diff --git a/tests/interfaces/openlp_plugins/custom/forms/test_customform.py b/tests/interfaces/openlp_plugins/custom/forms/test_customform.py index d9cf1b00c..383af254b 100644 --- a/tests/interfaces/openlp_plugins/custom/forms/test_customform.py +++ b/tests/interfaces/openlp_plugins/custom/forms/test_customform.py @@ -28,9 +28,7 @@ from unittest.mock import MagicMock, patch from PyQt5 import QtTest, QtCore, QtWidgets from openlp.core.common.registry import Registry -from openlp.plugins.custom.lib.mediaitem import CustomMediaItem from openlp.plugins.custom.forms.editcustomform import EditCustomForm - from tests.helpers.testmixin import TestMixin diff --git a/tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py b/tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py index 97d9bb652..cfae756ab 100644 --- a/tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py +++ b/tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py @@ -29,7 +29,6 @@ from PyQt5 import QtWidgets from openlp.core.common.registry import Registry from openlp.plugins.custom.forms.editcustomslideform import EditCustomSlideForm - from tests.helpers.testmixin import TestMixin diff --git a/tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py b/tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py index a25759732..42d2c6ccf 100644 --- a/tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py +++ b/tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py @@ -31,7 +31,6 @@ from openlp.core.common.i18n import UiStrings from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.plugins.songs.forms.editsongform import EditSongForm - from tests.helpers.testmixin import TestMixin __default_settings__ = { diff --git a/tests/interfaces/openlp_plugins/songs/forms/test_songmaintenanceform.py b/tests/interfaces/openlp_plugins/songs/forms/test_songmaintenanceform.py index d9786db7a..7fb6d83c6 100644 --- a/tests/interfaces/openlp_plugins/songs/forms/test_songmaintenanceform.py +++ b/tests/interfaces/openlp_plugins/songs/forms/test_songmaintenanceform.py @@ -30,7 +30,6 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common.i18n import UiStrings from openlp.core.common.registry import Registry from openlp.plugins.songs.forms.songmaintenanceform import SongMaintenanceForm - from tests.helpers.testmixin import TestMixin