Yet more tests

This commit is contained in:
Tim Bentley 2014-03-11 20:10:46 +00:00
parent a74567b9f6
commit 6935adde29
4 changed files with 37 additions and 19 deletions

View File

@ -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::

View File

@ -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 #
###############################################################################

View File

@ -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')

View File

@ -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):
"""