From 023753b2fcd9840541f5e379d3eddab75c6fecf5 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 15 Jul 2018 20:54:41 +0100 Subject: [PATCH] fix tests --- openlp/core/ui/icons.py | 5 ++++- tests/functional/openlp_core/ui/test_icons.py | 17 ----------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/openlp/core/ui/icons.py b/openlp/core/ui/icons.py index 183e591e7..77adb06e2 100644 --- a/openlp/core/ui/icons.py +++ b/openlp/core/ui/icons.py @@ -22,6 +22,7 @@ """ The :mod:`languages` module provides a list of icons. """ +import logging import qtawesome as qta from PyQt5 import QtGui, QtWidgets @@ -29,6 +30,8 @@ from PyQt5 import QtGui, QtWidgets from openlp.core.common.applocation import AppLocation from openlp.core.lib import build_icon +log = logging.getLogger(__name__) + class UiIcons(object): """ @@ -171,7 +174,7 @@ class UiIcons(object): setattr(self, key, qta.icon(icon)) except Exception: import sys - print("Unexpected error:", sys.exc_info()) + log.error("Unexpected error:", sys.exc_info()) setattr(self, key, qta.icon('fa.plus-circle', color='red')) except: setattr(self, key, qta.icon('fa.plus-circle', color='red')) diff --git a/tests/functional/openlp_core/ui/test_icons.py b/tests/functional/openlp_core/ui/test_icons.py index 33cf107a6..cea393311 100644 --- a/tests/functional/openlp_core/ui/test_icons.py +++ b/tests/functional/openlp_core/ui/test_icons.py @@ -48,20 +48,3 @@ class TestIcons(TestCase, TestMixin): icon_active = UiIcons().active # THEN: I should have an icon assert isinstance(icon_active, QtGui.QIcon) - - @patch('openlp.core.ui.icons.UiIcons.load') - def test_simple_icon_mission(self, _): - # GIVEN: an basic set of icons - icons = UiIcons() - icon_list = { - 'active': {'icon': 'fa.child_lost'} - - } - - icons.load_icons(icon_list) - # WHEN: I use the icons - icon_active = UiIcons().active - # THEN: I should have an icon - assert isinstance(icon_active, QtGui.QIcon) - -