diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index 43f93cf2c..259e65281 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -281,7 +281,7 @@ class Controller(object): class MessageListener(object): """ - This is the Presentation listener who acts on events from the slide controller and passes the messages on the the + This is the Presentation listener who acts on events from the slide controller and passes the messages on the correct presentation handlers """ log.info('Message Listener loaded') diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index 17911606c..9990d3f66 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -292,8 +292,8 @@ class PresentationDocument(object): class PresentationController(object): """ - This class is used to control interactions with presentation applications by creating a runtime environment. This is - a base class for presentation controllers to inherit from. + This class is used to control interactions with presentation applications by creating a runtime environment. + This is a base class for presentation controllers to inherit from. To create a new controller, take a copy of this file and name it so it ends with ``controller.py``, i.e. ``foobarcontroller.py``. Make sure it inherits @@ -341,8 +341,7 @@ class PresentationController(object): """ log.info('PresentationController loaded') - def __init__(self, plugin=None, name='PresentationController', - document_class=PresentationDocument): + def __init__(self, plugin=None, name='PresentationController', document_class=PresentationDocument): """ This is the constructor for the presentationcontroller object. This provides an easy way for descendent plugins to populate common data. This method *must* be overridden, like so:: diff --git a/tests/functional/openlp_plugins/presentations/test_presentationcontroller.py b/tests/functional/openlp_plugins/presentations/test_presentationcontroller.py new file mode 100644 index 000000000..61d62b473 --- /dev/null +++ b/tests/functional/openlp_plugins/presentations/test_presentationcontroller.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2013 Raoul Snyman # +# Portions copyright (c) 2008-2013 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 # +############################################################################### +""" +This module contains tests for the Presentation Controller. +""" +from unittest import TestCase + +from openlp.plugins.presentations.lib.presentationcontroller import PresentationController +from tests.functional import MagicMock + +class TestPresentationController(TestCase): + """ + Test the PresentationController. + """ + def constructor_test(self): + """ + Test the Constructor + """ + # GIVEN: No presentation controller + controller = None + + # WHEN: The presentation controller object is created + controller = PresentationController(plugin=MagicMock()) + + # THEN: The name of the presentation controller should be correct + self.assertEqual('PresentationController', controller.name, + 'The name of the presentation controller should be correct')