From a74567b9f64a54485d4b4bb607166ee2a3714998 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Tue, 11 Mar 2014 19:01:09 +0000 Subject: [PATCH] Bible database tests --- openlp/core/lib/db.py | 97 +++++--------- openlp/plugins/bibles/lib/__init__.py | 28 ++-- openlp/plugins/bibles/lib/db.py | 30 ++--- openlp/plugins/bibles/lib/manager.py | 25 ++-- .../openlp_plugins/bibles/__init__.py | 29 ++++- .../openlp_plugins/bibles/test_lib_http.py | 28 ++++ .../openlp_plugins/bibles/test_lib_manager.py | 120 ++++++++++++++++++ .../openlp_plugins/custom/__init__.py | 28 ++++ .../custom/forms/test_customform.py | 28 ++++ tests/resources/bibles/tests.sqlite | Bin 0 -> 26624 bytes 10 files changed, 297 insertions(+), 116 deletions(-) create mode 100644 tests/interfaces/openlp_plugins/bibles/test_lib_manager.py create mode 100644 tests/resources/bibles/tests.sqlite diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index 7e573ae2e..36bfa24ef 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -82,11 +82,8 @@ def upgrade_db(url, upgrade): """ Upgrade a database. - ``url`` - The url of the database to upgrade. - - ``upgrade`` - The python module that contains the upgrade instructions. + :param url: The url of the database to upgrade. + :param upgrade: The python module that contains the upgrade instructions. """ session, metadata = init_db(url) @@ -99,7 +96,7 @@ def upgrade_db(url, upgrade): metadata_table = Table('metadata', metadata, Column('key', types.Unicode(64), primary_key=True), Column('value', types.UnicodeText(), default=None) - ) + ) metadata_table.create(checkfirst=True) mapper(Metadata, metadata_table) version_meta = session.query(Metadata).get('version') @@ -137,11 +134,8 @@ def delete_database(plugin_name, db_file_name=None): """ Remove a database file from the system. - ``plugin_name`` - The name of the plugin to remove the database for - - ``db_file_name`` - The database file name. Defaults to None resulting in the plugin_name being used. + :param plugin_name: The name of the plugin to remove the database for + :param db_file_name: The database file name. Defaults to None resulting in the plugin_name being used. """ db_file_path = None if db_file_name: @@ -175,17 +169,11 @@ class Manager(object): Runs the initialisation process that includes creating the connection to the database and the tables if they do not exist. - ``plugin_name`` - The name to setup paths and settings section names - - ``init_schema`` - The init_schema function for this database - - ``upgrade_schema`` - The upgrade_schema function for this database - - ``db_file_name`` - The file name to use for this database. Defaults to None resulting in the plugin_name being used. + :param plugin_name: The name to setup paths and settings section names + :param init_schema: The init_schema function for this database + :param db_file_name: The upgrade_schema function for this database + :param upgrade_mod: The file name to use for this database. Defaults to None resulting in the plugin_name + being used. """ settings = Settings() settings.beginGroup(plugin_name) @@ -208,7 +196,10 @@ class Manager(object): self.db_url += '?charset=%s' % urlquote(db_encoding) settings.endGroup() if upgrade_mod: - db_ver, up_ver = upgrade_db(self.db_url, upgrade_mod) + try: + db_ver, up_ver = upgrade_db(self.db_url, upgrade_mod) + except (SQLAlchemyError, DBAPIError): + log.exception('Error loading database: %s', self.db_url) if db_ver > up_ver: critical_error_message_box( translate('OpenLP.Manager', 'Database Error'), @@ -229,11 +220,8 @@ class Manager(object): """ Save an object to the database - ``object_instance`` - The object to save - - ``commit`` - Commit the session with this object + :param object_instance: The object to save + :param commit: Commit the session with this object """ for try_count in range(3): try: @@ -262,11 +250,8 @@ class Manager(object): """ Save a list of objects to the database - ``object_list`` - The list of objects to save - - ``commit`` - Commit the session with this object + :param object_list: The list of objects to save + :param commit: Commit the session with this object """ for try_count in range(3): try: @@ -295,11 +280,8 @@ class Manager(object): """ Return the details of an object - ``object_class`` - The type of object to return - - ``key`` - The unique reference or primary key for the instance to return + :param object_class: The type of object to return + :param key: The unique reference or primary key for the instance to return """ if not key: return object_class() @@ -319,11 +301,8 @@ class Manager(object): """ Returns an object matching specified criteria - ``object_class`` - The type of object to return - - ``filter_clause`` - The criteria to select the object by + :param object_class: The type of object to return + :param filter_clause: The criteria to select the object by """ for try_count in range(3): try: @@ -340,14 +319,9 @@ class Manager(object): """ Returns all the objects from the database - ``object_class`` - The type of objects to return - - ``filter_clause`` - The filter governing selection of objects to return. Defaults to None. - - ``order_by_ref`` - Any parameters to order the returned objects by. Defaults to None. + :param object_class: The type of objects to return + :param filter_clause: The filter governing selection of objects to return. Defaults to None. + :param order_by_ref: Any parameters to order the returned objects by. Defaults to None. """ query = self.session.query(object_class) if filter_clause is not None: @@ -371,11 +345,8 @@ class Manager(object): """ Returns a count of the number of objects in the database. - ``object_class`` - The type of objects to return. - - ``filter_clause`` - The filter governing selection of objects to return. Defaults to None. + :param object_class: The type of objects to return. + :param filter_clause: The filter governing selection of objects to return. Defaults to None. """ query = self.session.query(object_class) if filter_clause is not None: @@ -395,11 +366,8 @@ class Manager(object): """ Delete an object from the database - ``object_class`` - The type of object to delete - - ``key`` - The unique reference or primary key for the instance to be deleted + :param object_class: The type of object to delete + :param key: The unique reference or primary key for the instance to be deleted """ if key != 0: object_instance = self.get_object(object_class, key) @@ -432,11 +400,8 @@ class Manager(object): Delete all object records. This method should only be used for simple tables and **not** ones with relationships. The relationships are not deleted from the database and this will lead to database corruptions. - ``object_class`` - The type of object to delete - - ``filter_clause`` - The filter governing selection of objects to return. Defaults to None. + :param object_class: The type of object to delete + :param filter_clause: The filter governing selection of objects to return. Defaults to None. """ for try_count in range(3): try: diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index b8c0c0ed9..74b5445f7 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -182,9 +182,10 @@ def update_reference_separators(): """ Updates separators and matches for parsing and formating scripture references. """ - default_separators = translate('BiblesPlugin', - ':|v|V|verse|verses;;-|to;;,|and;;end Double-semicolon delimited separators for parsing references. ' - 'Consult the developers for further information.').split(';;') + default_separators = \ + translate('BiblesPlugin', + ':|v|V|verse|verses;;-|to;;,|and;;end Double-semicolon delimited separators for parsing references. ' + 'Consult the developers for further information.').split(';;') settings = Settings() settings.beginGroup('bibles') custom_separators = [ @@ -206,8 +207,7 @@ def update_reference_separators(): for character in '\\.^$*+?{}[]()': source_string = source_string.replace(character, '\\' + character) # add various unicode alternatives - source_string = source_string.replace('-', - '(?:[-\u00AD\u2010\u2011\u2012\u2014\u2014\u2212\uFE63\uFF0D])') + source_string = source_string.replace('-', '(?:[-\u00AD\u2010\u2011\u2012\u2014\u2014\u2212\uFE63\uFF0D])') source_string = source_string.replace(',', '(?:[,\u201A])') REFERENCE_SEPARATORS['sep_%s' % role] = '\s*(?:%s)\s*' % source_string REFERENCE_SEPARATORS['sep_%s_default' % role] = default_separators[index] @@ -227,8 +227,7 @@ def get_reference_separator(separator_type): """ Provides separators for parsing and formatting scripture references. - ``separator_type`` - The role and format of the separator. + :param separator_type: The role and format of the separator. """ if not REFERENCE_SEPARATORS: update_reference_separators() @@ -239,8 +238,7 @@ def get_reference_match(match_type): """ Provides matches for parsing scripture references strings. - ``match_type`` - The type of match is ``range_separator``, ``range`` or ``full``. + :param match_type: The type of match is ``range_separator``, ``range`` or ``full``. """ if not REFERENCE_MATCHES: update_reference_separators() @@ -410,15 +408,9 @@ class SearchResults(object): """ Create the search result object. - ``book`` - The book of the Bible. - - ``chapter`` - The chapter of the book. - - ``verse_list`` - The list of verses for this reading. - + :param book: The book of the Bible. + :param chapter: The chapter of the book. + :param verse_list: The list of verses for this reading. """ self.book = book self.chapter = chapter diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 2074d7a28..36b8a0bf2 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -48,6 +48,7 @@ log = logging.getLogger(__name__) RESERVED_CHARACTERS = '\\.^$*+?{}[]()' + class BibleMeta(BaseModel): """ Bible Meta Data @@ -117,9 +118,8 @@ def init_schema(url): class BibleDB(QtCore.QObject, Manager): """ - This class represents a database-bound Bible. It is used as a base class - for all the custom importers, so that the can implement their own import - methods, but benefit from the database methods in here via inheritance, + This class represents a database-bound Bible. It is used as a base class for all the custom importers, so that + the can implement their own import methods, but benefit from the database methods in here via inheritance, rather than depending on yet another object. """ log.info('BibleDB loaded') @@ -129,14 +129,13 @@ class BibleDB(QtCore.QObject, Manager): The constructor loads up the database and creates and initialises the tables if the database doesn't exist. - **Required keyword arguments:** + :param parent: + :param kwargs: + ``path`` + The path to the bible database file. - ``path`` - The path to the bible database file. - - ``name`` - The name of the database. This is also used as the file name for - SQLite databases. + ``name`` + The name of the database. This is also used as the file name for SQLite databases. """ log.info('BibleDB loaded') QtCore.QObject.__init__(self) @@ -178,9 +177,8 @@ class BibleDB(QtCore.QObject, Manager): def register(self, wizard): """ - This method basically just initialialises the database. It is called - from the Bible Manager when a Bible is imported. Descendant classes - may want to override this method to supply their own custom + This method basically just initialises the database. It is called from the Bible Manager when a Bible is + imported. Descendant classes may want to override this method to supply their own custom initialisation as well. :param wizard: The actual Qt wizard form. @@ -422,13 +420,11 @@ class BibleDB(QtCore.QObject, Manager): log.debug('BibleDB.verse_search("%s")', text) verses = self.session.query(Verse) if text.find(',') > -1: - keywords = \ - ['%%%s%%' % keyword.strip() for keyword in text.split(',')] + keywords = ['%%%s%%' % keyword.strip() for keyword in text.split(',')] or_clause = [Verse.text.like(keyword) for keyword in keywords] verses = verses.filter(or_(*or_clause)) else: - keywords = \ - ['%%%s%%' % keyword.strip() for keyword in text.split(' ')] + keywords = ['%%%s%%' % keyword.strip() for keyword in text.split(' ')] for keyword in keywords: verses = verses.filter(Verse.text.like(keyword)) verses = verses.all() diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index e589b2eaa..53bab5f6b 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -58,8 +58,7 @@ class BibleFormat(object): """ Return the appropriate implementation class. - ``format`` - The Bible format. + :param format: The Bible format. """ if format == BibleFormat.OSIS: return OSISBible @@ -93,9 +92,8 @@ class BibleManager(object): def __init__(self, parent): """ - Finds all the bibles defined for the system and creates an interface - object for each bible containing connection information. Throws - Exception if no Bibles are found. + Finds all the bibles defined for the system and creates an interface object for each bible containing + connection information. Throws Exception if no Bibles are found. Init confirms the bible exists and stores the database path. """ @@ -113,9 +111,8 @@ class BibleManager(object): def reload_bibles(self): """ - Reloads the Bibles from the available Bible databases on disk. If a web - Bible is encountered, an instance of HTTPBible is loaded instead of the - BibleDB class. + Reloads the Bibles from the available Bible databases on disk. If a web Bible is encountered, an instance + of HTTPBible is loaded instead of the BibleDB class. """ log.debug('Reload bibles') files = AppLocation.get_files(self.settings_section, self.suffix) @@ -276,9 +273,9 @@ class BibleManager(object): ) return None language_selection = self.get_language_selection(bible) - reflist = parse_reference(verse_text, self.db_cache[bible], language_selection, book_ref_id) - if reflist: - return self.db_cache[bible].get_verses(reflist, show_error) + ref_list = parse_reference(verse_text, self.db_cache[bible], language_selection, book_ref_id) + if ref_list: + return self.db_cache[bible].get_verses(ref_list, show_error) else: if show_error: reference_separators = { @@ -343,10 +340,10 @@ class BibleManager(object): return None # Check if the bible or second_bible is a web bible. web_bible = self.db_cache[bible].get_object(BibleMeta, 'download_source') - second_webbible = '' + second_web_bible = '' if second_bible: - second_webbible = self.db_cache[second_bible].get_object(BibleMeta, 'download_source') - if web_bible or second_webbible: + second_web_bible = self.db_cache[second_bible].get_object(BibleMeta, 'download_source') + if web_bible or second_web_bible: self.main_window.information_message( translate('BiblesPlugin.BibleManager', 'Web Bible cannot be used'), translate('BiblesPlugin.BibleManager', 'Text Search is not available with Web Bibles.') diff --git a/tests/interfaces/openlp_plugins/bibles/__init__.py b/tests/interfaces/openlp_plugins/bibles/__init__.py index f87606f07..6b241e7fc 100644 --- a/tests/interfaces/openlp_plugins/bibles/__init__.py +++ b/tests/interfaces/openlp_plugins/bibles/__init__.py @@ -1 +1,28 @@ -__author__ = 'tim' +# -*- 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 # +############################################################################### diff --git a/tests/interfaces/openlp_plugins/bibles/test_lib_http.py b/tests/interfaces/openlp_plugins/bibles/test_lib_http.py index 386900a9b..9f90df64e 100644 --- a/tests/interfaces/openlp_plugins/bibles/test_lib_http.py +++ b/tests/interfaces/openlp_plugins/bibles/test_lib_http.py @@ -1,3 +1,31 @@ +# -*- 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 # +############################################################################### """ Package to test the openlp.plugin.bible.lib.https package. """ diff --git a/tests/interfaces/openlp_plugins/bibles/test_lib_manager.py b/tests/interfaces/openlp_plugins/bibles/test_lib_manager.py new file mode 100644 index 000000000..253779a5c --- /dev/null +++ b/tests/interfaces/openlp_plugins/bibles/test_lib_manager.py @@ -0,0 +1,120 @@ +# -*- 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 Bible Manager class and related methods. +""" +import os +from tempfile import mkstemp +from unittest import TestCase + +from openlp.core.common import Registry, Settings +from openlp.plugins.bibles.lib import BibleManager, LanguageSelection +from tests.interfaces import MagicMock, patch + +from tests.utils.constants import TEST_RESOURCES_PATH + + +class TestBibleManager(TestCase): + + def setUp(self): + """ + Set up the environment for testing bible queries with 1 Timothy 3 + """ + fd, self.ini_file = mkstemp('.ini') + Settings().set_filename(self.ini_file) + Registry.create() + Registry().register('service_list', MagicMock()) + Registry().register('application', MagicMock()) + bible_settings = { + 'bibles/proxy name': '', + 'bibles/db type': 'sqlite', + 'bibles/book name language': LanguageSelection.Bible, + 'bibles/verse separator': '', + 'bibles/range separator': '', + 'bibles/list separator': '', + 'bibles/end separator': '', + } + Settings().extend_default_settings(bible_settings) + with patch('openlp.core.common.applocation.Settings') as mocked_class, \ + patch('openlp.core.common.AppLocation.get_section_data_path') as mocked_get_section_data_path, \ + patch('openlp.core.common.AppLocation.get_files') as mocked_get_files: + # GIVEN: A mocked out Settings class and a mocked out AppLocation.get_files() + mocked_settings = mocked_class.return_value + mocked_settings.contains.return_value = False + mocked_get_files.return_value = ["tests.sqlite"] + mocked_get_section_data_path.return_value = TEST_RESOURCES_PATH + "/bibles" + self.manager = BibleManager(MagicMock()) + + def tearDown(self): + """ + Delete all the C++ objects at the end so that we don't have a segfault + """ + os.unlink(self.ini_file) + + def get_books_test(self): + """ + Test the get_books method + """ + # GIVEN given a bible in the bible manager + # WHEN asking for the books of the bible + books = self.manager.get_books('tests') + # THEN a list of books should be returned + self.assertEqual(66, len(books), 'There should be 66 books in the bible') + + def get_book_by_id_test(self): + """ + Test the get_book_by_id method + """ + # GIVEN given a bible in the bible manager + # WHEN asking for the book of the bible + book = self.manager.get_book_by_id('tests', 54) + # THEN a book should be returned + self.assertEqual('1 Timothy', book.name, '1 Timothy should have been returned from the bible') + + def get_chapter_count_test(self): + """ + Test the get_chapter_count method + """ + # GIVEN given a bible in the bible manager + # WHEN asking for the chapters in a book of the bible + book = self.manager.get_book_by_id('tests', 54) + chapter = self.manager.get_chapter_count('tests', book) + # THEN the chapter count should be returned + self.assertEqual(6, chapter, '1 Timothy should have 6 chapters returned from the bible') + + def get_verse_count_by_book_ref_id_test(self): + """ + Test the get_verse_count_by_book_ref_id method + """ + # GIVEN given a bible in the bible manager + # WHEN asking for the number of verses in a book of the bible + verses = self.manager.get_verse_count_by_book_ref_id('tests', 54, 3) + # THEN the chapter count should be returned + self.assertEqual(16, verses, '1 Timothy v3 should have 16 verses returned from the bible') + diff --git a/tests/interfaces/openlp_plugins/custom/__init__.py b/tests/interfaces/openlp_plugins/custom/__init__.py index e69de29bb..6b241e7fc 100644 --- a/tests/interfaces/openlp_plugins/custom/__init__.py +++ b/tests/interfaces/openlp_plugins/custom/__init__.py @@ -0,0 +1,28 @@ +# -*- 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 # +############################################################################### diff --git a/tests/interfaces/openlp_plugins/custom/forms/test_customform.py b/tests/interfaces/openlp_plugins/custom/forms/test_customform.py index e933bb17d..f96e0842e 100644 --- a/tests/interfaces/openlp_plugins/custom/forms/test_customform.py +++ b/tests/interfaces/openlp_plugins/custom/forms/test_customform.py @@ -1,3 +1,31 @@ +# -*- 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 # +############################################################################### """ Module to test the EditCustomForm. """ diff --git a/tests/resources/bibles/tests.sqlite b/tests/resources/bibles/tests.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..b6af457d77f217674aa5b98fbb7f88fee9c930c0 GIT binary patch literal 26624 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 Bk^}$% literal 0 HcmV?d00001