From 6935adde2953a2269e64c0bf184a3f5ee4afd155 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 11 Mar 2014 20:10:46 +0000 Subject: [PATCH] Yet more tests --- openlp/plugins/bibles/lib/__init__.py | 17 +++------- .../openlp_plugins/bibles/__init__.py | 31 +++++++++++++++++-- .../openlp_plugins/bibles/test_lib.py | 2 ++ .../bibles/test_versereferencelist.py | 6 ++-- 4 files changed, 37 insertions(+), 19 deletions(-) diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index 74b5445f7..39bee992f 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -250,19 +250,10 @@ def parse_reference(reference, bible, language_selection, book_ref_id=False): This is the next generation über-awesome function that takes a person's typed in string and converts it to a list of references to be queried from the Bible database files. - ``reference`` - A string. The Bible reference to parse. - - ``bible`` - A object. The Bible database object. - - ``language_selection`` - An int. The language selection the user has choosen in settings section. - - ``book_ref_id`` - A string. The book reference id. - - Returns ``None`` or a reference list. + :param reference: A string. The Bible reference to parse. + :param bible: A object. The Bible database object. + :param language_selection: An int. The language selection the user has chosen in settings section. + :param book_ref_id: A string. The book reference id. The reference list is a list of tuples, with each tuple structured like this:: diff --git a/tests/functional/openlp_plugins/bibles/__init__.py b/tests/functional/openlp_plugins/bibles/__init__.py index c60847dc0..1f4f74a33 100644 --- a/tests/functional/openlp_plugins/bibles/__init__.py +++ b/tests/functional/openlp_plugins/bibles/__init__.py @@ -1,3 +1,28 @@ -""" -Tests for the Bibles plugin -""" +# -*- 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 # +############################################################################### \ No newline at end of file diff --git a/tests/functional/openlp_plugins/bibles/test_lib.py b/tests/functional/openlp_plugins/bibles/test_lib.py index 0c8bb8211..9b3e79591 100644 --- a/tests/functional/openlp_plugins/bibles/test_lib.py +++ b/tests/functional/openlp_plugins/bibles/test_lib.py @@ -85,3 +85,5 @@ class TestLib(TestCase): # THEN: It should be False self.assertFalse(has_verse_list, 'The SearchResults object should have a verse list') + + diff --git a/tests/functional/openlp_plugins/bibles/test_versereferencelist.py b/tests/functional/openlp_plugins/bibles/test_versereferencelist.py index a7481ac57..8b7c3f786 100644 --- a/tests/functional/openlp_plugins/bibles/test_versereferencelist.py +++ b/tests/functional/openlp_plugins/bibles/test_versereferencelist.py @@ -83,7 +83,7 @@ class TestVerseReferenceList(TestCase): # THEN: The current index should be 0 and the end pointer of the entry should be '2' self.assertEqual(reference_list.current_index, 0, 'The current index should be 0') self.assertEqual(reference_list.verse_list[0]['end'], next_verse, - 'The end in first entry should be %u' % next_verse) + 'The end in first entry should be %u' % next_verse) def add_another_verse_test(self): """ @@ -124,8 +124,8 @@ class TestVerseReferenceList(TestCase): # THEN: the data will be appended to the list self.assertEqual(len(reference_list.version_list), 1, 'The version data should be appended') self.assertEqual(reference_list.version_list[0], - {'version': version, 'copyright': copyright_, 'permission': permission}, - 'The version data should be appended') + {'version': version, 'copyright': copyright_, 'permission': permission}, + 'The version data should be appended') def add_existing_version_test(self): """