← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~raoul-snyman/openlp/better-tabs into lp:openlp

 

Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/better-tabs into lp:openlp.

Requested reviews:
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/better-tabs/+merge/214341

Playing with the tabs on the "Library" toolbox. Added a test.

--------------------------------
[SUCCESS] http://ci.openlp.org/job/Branch-01-Pull/214/
[SUCCESS] http://ci.openlp.org/job/Branch-02-Functional-Tests/181/
[SUCCESS] http://ci.openlp.org/job/Branch-03-Interface-Tests/130/
[SUCCESS] http://ci.openlp.org/job/Branch-04-Windows_Tests/92/
[SUCCESS] http://ci.openlp.org/job/Branch-05-Code-Analysis/24/

-- 
https://code.launchpad.net/~raoul-snyman/openlp/better-tabs/+merge/214341
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/common/__init__.py'
--- openlp/core/common/__init__.py	2014-04-04 20:20:00 +0000
+++ openlp/core/common/__init__.py	2014-04-04 21:24:03 +0000
@@ -76,6 +76,9 @@
 def get_frozen_path(frozen_option, non_frozen_option):
     """
     Return a path based on the system status.
+
+    :param frozen_option:
+    :param non_frozen_option:
     """
     if hasattr(sys, 'frozen') and sys.frozen == 1:
         return frozen_option

=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py	2014-03-28 20:38:38 +0000
+++ openlp/core/ui/mainwindow.py	2014-04-04 21:24:03 +0000
@@ -56,29 +56,27 @@
 log = logging.getLogger(__name__)
 
 MEDIA_MANAGER_STYLE = """
-  QToolBox {
+QToolBox {
     padding-bottom: 2px;
-  }
-  QToolBox::tab {
-    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
-        stop: 0 palette(button), stop: 0.5 palette(button),
-        stop: 1.0 palette(mid));
-    border: 1px groove palette(mid);
-    border-radius: 5px;
-  }
-  QToolBox::tab:selected {
-    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
-        stop: 0 palette(light), stop: 0.5 palette(midlight),
-        stop: 1.0 palette(dark));
-    border: 1px groove palette(dark);
+}
+QToolBox::tab {
+    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+        stop: 0 palette(button), stop: 1.0 palette(mid));
+    border: 1px solid palette(mid);
+    border-radius: 3px;
+}
+QToolBox::tab:selected {
+    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
+        stop: 0 palette(light), stop: 1.0 palette(button));
+    border: 1px solid palette(mid);
     font-weight: bold;
-  }
+}
 """
 
 PROGRESSBAR_STYLE = """
-    QProgressBar{
-       height: 10px;
-    }
+QProgressBar{
+    height: 10px;
+}
 """
 
 

=== added file 'tests/functional/openlp_core_common/test_common.py'
--- tests/functional/openlp_core_common/test_common.py	1970-01-01 00:00:00 +0000
+++ tests/functional/openlp_core_common/test_common.py	2014-04-04 21:24:03 +0000
@@ -0,0 +1,83 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
+
+###############################################################################
+# OpenLP - Open Source Lyrics Projection                                      #
+# --------------------------------------------------------------------------- #
+# Copyright (c) 2008-2014 Raoul Snyman                                        #
+# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan      #
+# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub,      #
+# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer.   #
+# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru,          #
+# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith,             #
+# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock,              #
+# Frode Woldsund, Martin Zibricky, Patrick Zimmermann                         #
+# --------------------------------------------------------------------------- #
+# This program is free software; you can redistribute it and/or modify it     #
+# under the terms of the GNU General Public License as published by the Free  #
+# Software Foundation; version 2 of the License.                              #
+#                                                                             #
+# This program is distributed in the hope that it will be useful, but WITHOUT #
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       #
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    #
+# more details.                                                               #
+#                                                                             #
+# You should have received a copy of the GNU General Public License along     #
+# with this program; if not, write to the Free Software Foundation, Inc., 59  #
+# Temple Place, Suite 330, Boston, MA 02111-1307 USA                          #
+###############################################################################
+"""
+Functional tests to test the AppLocation class and related methods.
+"""
+
+from unittest import TestCase
+
+from openlp.core.common import de_hump, trace_error_handler
+from tests.functional import MagicMock, patch
+
+
+class TestCommonFunctions(TestCase):
+    """
+    A test suite to test out various functions in the openlp.core.common module.
+    """
+    def de_hump_conversion_test(self):
+        """
+        Test the de_hump function with a class name
+        """
+        # GIVEN: a Class name in Camel Case
+        string = "MyClass"
+
+        # WHEN: we call de_hump
+        new_string = de_hump(string)
+
+        # THEN: the new string should be converted to python format
+        self.assertTrue(new_string == "my_class", 'The class name should have been converted')
+
+    def de_hump_static_test(self):
+        """
+        Test the de_hump function with a python string
+        """
+        # GIVEN: a Class name in Camel Case
+        string = "my_class"
+
+        # WHEN: we call de_hump
+        new_string = de_hump(string)
+
+        # THEN: the new string should be converted to python format
+        self.assertTrue(new_string == "my_class", 'The class name should have been preserved')
+
+    def trace_error_handler_test(self):
+        """
+        Test the trace_error_handler() method
+        """
+        # GIVEN: Mocked out objects
+        with patch('openlp.core.common.traceback') as mocked_traceback:
+            mocked_traceback.extract_stack.return_value = [('openlp.fake', 56, None, 'trace_error_handler_test')]
+            mocked_logger = MagicMock()
+
+            # WHEN: trace_error_handler() is called
+            trace_error_handler(mocked_logger)
+
+            # THEN: The mocked_logger.error() method should have been called with the correct parameters
+            mocked_logger.error.assert_called_with('OpenLP Error trace\n   File openlp.fake at line 56 \n\t called trace_error_handler_test')
+

=== removed file 'tests/functional/openlp_core_common/test_init.py'
--- tests/functional/openlp_core_common/test_init.py	2013-12-30 19:50:34 +0000
+++ tests/functional/openlp_core_common/test_init.py	1970-01-01 00:00:00 +0000
@@ -1,66 +0,0 @@
-# -*- coding: utf-8 -*-
-# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
-
-###############################################################################
-# OpenLP - Open Source Lyrics Projection                                      #
-# --------------------------------------------------------------------------- #
-# Copyright (c) 2008-2014 Raoul Snyman                                        #
-# Portions copyright (c) 2008-2014 Tim Bentley, Gerald Britton, Jonathan      #
-# Corwin, Samuel Findlay, Michael Gorven, Scott Guerrieri, Matthias Hub,      #
-# Meinert Jordan, Armin Köhler, Erik Lundin, Edwin Lunando, Brian T. Meyer.   #
-# Joshua Miller, Stevan Pettit, Andreas Preikschat, Mattias Põldaru,          #
-# Christian Richter, Philip Ridout, Simon Scudder, Jeffrey Smith,             #
-# Maikel Stuivenberg, Martin Thompson, Jon Tibble, Dave Warnock,              #
-# Frode Woldsund, Martin Zibricky, Patrick Zimmermann                         #
-# --------------------------------------------------------------------------- #
-# This program is free software; you can redistribute it and/or modify it     #
-# under the terms of the GNU General Public License as published by the Free  #
-# Software Foundation; version 2 of the License.                              #
-#                                                                             #
-# This program is distributed in the hope that it will be useful, but WITHOUT #
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       #
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for    #
-# more details.                                                               #
-#                                                                             #
-# You should have received a copy of the GNU General Public License along     #
-# with this program; if not, write to the Free Software Foundation, Inc., 59  #
-# Temple Place, Suite 330, Boston, MA 02111-1307 USA                          #
-###############################################################################
-"""
-Functional tests to test the AppLocation class and related methods.
-"""
-
-from unittest import TestCase
-
-from openlp.core.common import de_hump
-
-
-class TestInitFunctions(TestCase):
-    """
-    A test suite to test out various functions in the __init__ class.
-    """
-    def de_hump_conversion_test(self):
-        """
-        Test the de_hump function with a class name
-        """
-        # GIVEN: a Class name in Camel Case
-        string = "MyClass"
-
-        # WHEN: we call de_hump
-        new_string = de_hump(string)
-
-        # THEN: the new string should be converted to python format
-        self.assertTrue(new_string == "my_class", 'The class name should have been converted')
-
-    def de_hump_static_test(self):
-        """
-        Test the de_hump function with a python string
-        """
-        # GIVEN: a Class name in Camel Case
-        string = "my_class"
-
-        # WHEN: we call de_hump
-        new_string = de_hump(string)
-
-        # THEN: the new string should be converted to python format
-        self.assertTrue(new_string == "my_class", 'The class name should have been preserved')

=== modified file 'tests/functional/openlp_core_lib/test_db.py'
--- tests/functional/openlp_core_lib/test_db.py	2014-04-02 18:51:21 +0000
+++ tests/functional/openlp_core_lib/test_db.py	2014-04-04 21:24:03 +0000
@@ -50,8 +50,8 @@
         """
         # GIVEN: Mocked out SQLAlchemy calls and return objects, and an in-memory SQLite database URL
         with patch('openlp.core.lib.db.create_engine') as mocked_create_engine, \
-            patch('openlp.core.lib.db.MetaData') as MockedMetaData, \
-            patch('openlp.core.lib.db.sessionmaker') as mocked_sessionmaker, \
+                patch('openlp.core.lib.db.MetaData') as MockedMetaData, \
+                patch('openlp.core.lib.db.sessionmaker') as mocked_sessionmaker, \
                 patch('openlp.core.lib.db.scoped_session') as mocked_scoped_session:
             mocked_engine = MagicMock()
             mocked_metadata = MagicMock()


Follow ups