From 224bd903031a45ee1215bfa12f307f5279214b7e Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 10 Dec 2008 19:20:31 +0000 Subject: [PATCH] remove stuff bzr-revno: 202 --- openlp/plugins/biblemanager/test/__init__.py | 18 --- .../test/biblebooks_msg_short.csv | 8 -- .../test/biblebooks_niv_short.csv | 9 -- .../test/bibleverses_msg_short.csv | 35 ------ .../test/bibleverses_niv_short.csv | 35 ------ openlp/plugins/biblemanager/test/rt | 1 - .../biblemanager/test/test_bibleManager.py | 118 ------------------ .../biblemanager/test/test_bibleManagerAPI.py | 95 -------------- .../biblemanager/test/test_bibleManagerCSV.py | 61 --------- .../test/test_bibleManagerOSIS.py | 60 --------- 10 files changed, 440 deletions(-) delete mode 100644 openlp/plugins/biblemanager/test/__init__.py delete mode 100644 openlp/plugins/biblemanager/test/biblebooks_msg_short.csv delete mode 100644 openlp/plugins/biblemanager/test/biblebooks_niv_short.csv delete mode 100644 openlp/plugins/biblemanager/test/bibleverses_msg_short.csv delete mode 100644 openlp/plugins/biblemanager/test/bibleverses_niv_short.csv delete mode 100755 openlp/plugins/biblemanager/test/rt delete mode 100644 openlp/plugins/biblemanager/test/test_bibleManager.py delete mode 100644 openlp/plugins/biblemanager/test/test_bibleManagerAPI.py delete mode 100644 openlp/plugins/biblemanager/test/test_bibleManagerCSV.py delete mode 100644 openlp/plugins/biblemanager/test/test_bibleManagerOSIS.py diff --git a/openlp/plugins/biblemanager/test/__init__.py b/openlp/plugins/biblemanager/test/__init__.py deleted file mode 100644 index 6635407f1..000000000 --- a/openlp/plugins/biblemanager/test/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -""" -OpenLP - Open Source Lyrics Projection -Copyright (c) 2008 Raoul Snyman -Portions copyright (c) 2008 Martin Thompson, Tim Bentley - -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/openlp/plugins/biblemanager/test/biblebooks_msg_short.csv b/openlp/plugins/biblemanager/test/biblebooks_msg_short.csv deleted file mode 100644 index 55df25ead..000000000 --- a/openlp/plugins/biblemanager/test/biblebooks_msg_short.csv +++ /dev/null @@ -1,8 +0,0 @@ -1,1,"Genesis","GEN" -2,1,"Exodus","EXOD" -3,1,"Leviticus","LEV" -4,1,"Numbers","NUM" -47,2,"Matthew","MATT" -48,2,"Mark","MARK" -49,2,"Luke","LUKE" -50,2,"John","JOHN" diff --git a/openlp/plugins/biblemanager/test/biblebooks_niv_short.csv b/openlp/plugins/biblemanager/test/biblebooks_niv_short.csv deleted file mode 100644 index 7e93c023b..000000000 --- a/openlp/plugins/biblemanager/test/biblebooks_niv_short.csv +++ /dev/null @@ -1,9 +0,0 @@ -1,1,"Genesis","GEN" -2,1,"Exodus","EXOD" -3,1,"Leviticus","LEV" -4,1,"Numbers","NUM" -46,1,"Malachi","MAL" -47,2,"Matthew","MATT" -48,2,"Mark","MARK" -49,2,"Luke","LUKE" -50,2,"John","JOHN" diff --git a/openlp/plugins/biblemanager/test/bibleverses_msg_short.csv b/openlp/plugins/biblemanager/test/bibleverses_msg_short.csv deleted file mode 100644 index 9519f1484..000000000 --- a/openlp/plugins/biblemanager/test/bibleverses_msg_short.csv +++ /dev/null @@ -1,35 +0,0 @@ -"Genesis",1,1,"First this: God created the Heavens and Earth - all you see, all you don't see." -"Genesis",1,2,"Earth was a soup of nothingness, a bottomless emptiness, an inky blackness. God's Spirit brooded like a bird above the watery abyss." -"Exodus",1,1,"These are the names of the Israelites who went to Egypt with Jacob, each bringing his family members:" -"Exodus",1,2,"Reuben, Simeon, Levi, and Judah," -"Exodus",2,1,"A man from the family of Levi married a Levite woman." -"Exodus",2,2,"The woman became pregnant and had a son. She saw there was something special about him and hid him. She hid him for three months." -"Leviticus",1,1,"God called Moses and spoke to him from the Tent of Meeting:" -"Leviticus",1,2,"""Speak to the People of Israel. Tell them, When anyone presents an offering to God, present an animal from either the herd or the flock." -"Leviticus",1,3,"""If the offering is a Whole-Burnt-Offering from the herd, present a male without a defect at the entrance to the Tent of Meeting that it may be accepted by God." -"Numbers",1,1,"God spoke to Moses in the Wilderness of Sinai at the Tent of Meeting on the first day of the second month in the second year after they had left Egypt. He said," -"Numbers",1,2,"""Number the congregation of the People of Israel by clans and families, writing down the names of every male." -"Matthew",1,1,"The family tree of Jesus Christ, David's son, Abraham's son:" -"Matthew",1,2,"Abraham had Isaac, Isaac had Jacob, Jacob had Judah and his brothers," -"Matthew",1,3,"Judah had Perez and Zerah (the mother was Tamar), Perez had Hezron, Hezron had Aram," -"Matthew",1,4,"Aram had Amminadab, Amminadab had Nahshon, Nahshon had Salmon," -"Matthew",1,5,"Salmon had Boaz (his mother was Rahab), Boaz had Obed (Ruth was the mother), Obed had Jesse," -"Matthew",1,6,"Jesse had David, and David became king. David had Solomon (Uriah's wife was the mother)," -"Matthew",1,7,"Solomon had Rehoboam, Rehoboam had Abijah, Abijah had Asa," -"Matthew",1,8,"Asa had Jehoshaphat, Jehoshaphat had Joram, Joram had Uzziah," -"Matthew",2,1,"After Jesus was born in Bethlehem village, Judah territory - this was during Herod's kingship - a band of scholars arrived in Jerusalem from the East." -"Matthew",2,2,"They asked around, ""Where can we find and pay homage to the newborn King of the Jews? We observed a star in the eastern sky that "Matthew",3,1,"While Jesus was living in the Galilean hills, John, called ""the Baptizer,"" was preaching in the desert country of Judea." -"Matthew",3,2,"His message was simple and austere, like his desert surroundings: ""Change your life. God's kingdom is here.""" -"Matthew",3,3,"John and his message were authorized by Isaiah's prophecy: Thunder in the desert! Prepare for God's arrival! Make the road smooth and straight!" -"Mark",1,1,"The good news of Jesus Christ - the Message! - begins here," -"Mark",1,2,"following to the letter the scroll of the prophet Isaiah. Watch closely: I'm sending my preacher ahead of you; He'll make the road smooth for you." -"Mark",1,3,"Thunder in the desert! Prepare for God's arrival! Make the road smooth and straight!" -"Luke",1,1,"So many others have tried their hand at putting together a story of the wonderful harvest of Scripture and history that took place among us," -"Luke",1,2,"using reports handed down by the original eyewitnesses who served this Word with their very lives." -"Luke",1,3,"Since I have investigated all the reports in close detail, starting from the story's beginning, I decided to write it all out for you, most honorable Theophilus," -"John",1,1,"The Word was first, the Word present to God, God present to the Word. The Word was God," -"John",1,2,"in readiness for God from day one." -"John",1,3,"Everything was created through him; nothing - not one thing! - came into being without him." -"John",2,1,"Three days later there was a wedding in the village of Cana in Galilee. Jesus' mother was there." -"John",2,2,"Jesus and his disciples were guests also." -"John",2,3,"When they started running low on wine at the wedding banquet, Jesus' mother told him, ""They're just about out of wine.""" diff --git a/openlp/plugins/biblemanager/test/bibleverses_niv_short.csv b/openlp/plugins/biblemanager/test/bibleverses_niv_short.csv deleted file mode 100644 index df1f5c436..000000000 --- a/openlp/plugins/biblemanager/test/bibleverses_niv_short.csv +++ /dev/null @@ -1,35 +0,0 @@ -"Genesis",1,1,"In the beginning God created the heavens and the earth." -"Genesis",1,2,"Now the earth was formless and empty, darkness was over the surface of the deep, and the Spirit of God was hovering over the waters." -"Exodus",1,1,"These are the names of the sons of Israel who went to Egypt with Jacob, each with his family:" -"Exodus",1,2,"Reuben, Simeon, Levi and Judah;" -"Exodus",2,1,"Now a man of the house of Levi married a Levite woman," -"Exodus",2,2,"and she became pregnant and gave birth to a son. When she saw that he was a fine child, she hid him for three months." -"Leviticus",1,1,"The Lord called to Moses and spoke to him from the Tent of Meeting. He said," -"Leviticus",1,2,"""Speak to the Israelites and say to them: 'When any of you brings an offering to the Lord, bring as your offering an animal from either the herd or the flock." -"Leviticus",1,3,"""'If the offering is a burnt offering from the herd, he is to offer a male without defect. He must present it at the entrance to the Tent of Meeting so that it will be acceptable to the Lord." -"Numbers",1,1,"The Lord spoke to Moses in the Tent of Meeting in the Desert of Sinai on the first day of the second month of the second year after the Israelites came out of Egypt. He said:" -"Numbers",1,2,"""Take a census of the whole Israelite community by their clans and families, listing every man by name, one by one." -"Matthew",1,1,"A record of the genealogy of Jesus Christ the son of David, the son of Abraham:" -"Matthew",1,2,"Abraham was the father of Isaac," -"Matthew",1,3,"Judah the father of Perez and Zerah, whose mother was Tamar," -"Matthew",1,4,"Ram the father of Amminadab," -"Matthew",1,5,"Salmon the father of Boaz, whose mother was Rahab," -"Matthew",1,6,"and Jesse the father of King David." -"Matthew",1,7,"Solomon the father of Rehoboam," -"Matthew",1,8,"Asa the father of Jehoshaphat," -"Matthew",2,1,"After Jesus was born in Bethlehem in Judea, during the time of King Herod, Magi from the east came to Jerusalem" -"Matthew",2,2,"and asked, ""Where is the one who has been born king of the Jews? We saw his star in the east and have come to worship "Matthew",3,1,"In those days John the Baptist came, preaching in the Desert of Judea" -"Matthew",3,2,"and saying, ""Repent, for the kingdom of heaven is near.""" -"Matthew",3,3,"This is he who was spoken of through the prophet Isaiah: ""A voice of one calling in the desert, 'Prepare the way for the Lord, make straight paths for him.'""" -"Mark",1,1,"The beginning of the gospel about Jesus Christ, the Son of God." -"Mark",1,2,"It is written in Isaiah the prophet: ""I will send my messenger ahead of you, who will prepare your way""--" -"Mark",1,3,"""a voice of one calling in the desert, 'Prepare the way for the Lord, make straight paths for him.'""" -"Luke",1,1,"Many have undertaken to draw up an account of the things that have been fulfilled among us," -"Luke",1,2,"just as they were handed down to us by those who from the first were eyewitnesses and servants of the word." -"Luke",1,3,"Therefore, since I myself have carefully investigated everything from the beginning, it seemed good also to me to write an orderly account for you, most excellent Theophilus," -"John",1,1,"In the beginning was the Word, and the Word was with God, and the Word was God." -"John",1,2,"He was with God in the beginning." -"John",1,3,"Through him all things were made; without him nothing was made that has been made." -"John",2,1,"On the third day a wedding took place at Cana in Galilee. Jesus' mother was there," -"John",2,2,"and Jesus and his disciples had also been invited to the wedding." -"John",2,3,"When the wine was gone, Jesus' mother said to him, ""They have no more wine.""" diff --git a/openlp/plugins/biblemanager/test/rt b/openlp/plugins/biblemanager/test/rt deleted file mode 100755 index 84998ec9b..000000000 --- a/openlp/plugins/biblemanager/test/rt +++ /dev/null @@ -1 +0,0 @@ -py.test --nocapture test_bibleManager.py diff --git a/openlp/plugins/biblemanager/test/test_bibleManager.py b/openlp/plugins/biblemanager/test/test_bibleManager.py deleted file mode 100644 index e530d8cac..000000000 --- a/openlp/plugins/biblemanager/test/test_bibleManager.py +++ /dev/null @@ -1,118 +0,0 @@ -""" -OpenLP - Open Source Lyrics Projection -Copyright (c) 2008 Raoul Snyman -Portions copyright (c) 2008 Martin Thompson, Tim Bentley - -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 -""" - -import random -import unittest - -import os, os.path -import sys -mypath=os.path.split(os.path.abspath(__file__))[0] -sys.path.insert(0,(os.path.join(mypath, '..', '..','..','..'))) - -from openlp.plugins.bibles.lib.biblemanager import BibleManager -from openlp.utils import ConfigHelper - -import logging -logging.basicConfig(level=logging.DEBUG, - format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', - datefmt='%m-%d %H:%M', - filename='plugins.log', - filemode='w') - -console=logging.StreamHandler() -# set a format which is simpler for console use -formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') -# tell the handler to use this format -console.setFormatter(formatter) -logging.getLogger('').addHandler(console) -log=logging.getLogger('') - -logging.info("\nLogging started") - -class TestBibleManager: - log=logging.getLogger("testBibleMgr") - def setup_class(self): - log.debug("\n.......Register BM") - self.bm = BibleManager() - - def testRegisterCSVBibleFiles(self): - # Register a bible from files - log.debug("\n.......testRegisterBibleFiles") - self.bm.registerFileBible("TheMessage",'biblebooks_msg_short.csv','bibleverses_msg_short.csv') - self.bm.registerFileBible("NIV",'biblebooks_niv_short.csv','bibleverses_niv_short.csv') - b = self.bm.getBibles() - for b1 in b: - log.debug( b1) - assert(b1 in b) - - def testRegisterHTTPBible(self): - # Register a bible from files - log.debug( "\n.......testRegisterBibleHTTP") - self.bm.registerHTTPBible("asv","Crosswalk", "", "", "") - self.bm.registerHTTPBible("nasb","Biblegateway", "", "", "") - self.bm.registerHTTPBible("nkj","Biblegateway", "http://tigger2:3128/", "", "") - b = self.bm.getBibles() - for b1 in b: - log.debug( b1) - assert(b1 in b) - - - def testGetBibles(self): - log.debug( "\n.......testGetBibles") - # make sure the shuffled sequence does not lose any elements - b = self.bm.getBibles() - for b1 in b: - log.debug( b1) - assert(b1 in b) - - def testGetBibleBooks(self): - log.debug( "\n.......testGetBibleBooks") - c = self.bm.getBibleBooks("NIV") - for c1 in c: - log.debug( c1) - assert(c1 in c) - - def testGetBookChapterCount(self): - log.debug( "\n.......testGetBookChapterCount") - assert(self.bm.getBookChapterCount("Matthew") == '28') - - def testGetBookVerseCount(self): - log.debug( "\n.......testGetBookVerseCount") - assert(self.bm.getBookVerseCount("Genesis", 1) == '31') - assert(self.bm.getBookVerseCount("Genesis", 2) == '25') - assert(self.bm.getBookVerseCount("Matthew", 1) == '25') - assert(self.bm.getBookVerseCount("Revelation", 1) == '20') - - def testGetVerseText(self): - log.debug( "\n.......testGetVerseText") - #c = self.bm.getVerseText("TheMessage",'Genesis',1,2,1) - #log.debug( c ) - #c = self.bm.getVerseText('NIV','Genesis',1,1,2) - #log.debug( c ) - c = self.bm.getVerseText('asv','Genesis',10,1,20) - log.debug( c ) - c = self.bm.getVerseText('nasb','Genesis',10,1,20) - log.debug( c ) - c = self.bm.getVerseText('nkj','Revelation',10,1,20) - log.debug( c ) - - def testLoadBible(self): - log.debug( "\n.......testLoadBible") - #self.bm.loadBible('asv') - #self.bm.loadBible('nasb') - #self.bm.loadBible('nkj') diff --git a/openlp/plugins/biblemanager/test/test_bibleManagerAPI.py b/openlp/plugins/biblemanager/test/test_bibleManagerAPI.py deleted file mode 100644 index ccde98a1e..000000000 --- a/openlp/plugins/biblemanager/test/test_bibleManagerAPI.py +++ /dev/null @@ -1,95 +0,0 @@ -""" -OpenLP - Open Source Lyrics Projection -Copyright (c) 2008 Raoul Snyman -Portions copyright (c) 2008 Martin Thompson, Tim Bentley - -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 -""" - -import random -import unittest - -import os, os.path -import sys -mypath=os.path.split(os.path.abspath(__file__))[0] -sys.path.insert(0,(os.path.join(mypath, '..', '..','..','..'))) - -from openlp.plugins.biblemanager.bibleManager import BibleManager -from openlp.core.utils import ConfigHelper - -import logging -logging.basicConfig(level=logging.DEBUG, - format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', - datefmt='%m-%d %H:%M', - filename='plugins.log', - filemode='w') - -console=logging.StreamHandler() -# set a format which is simpler for console use -formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') -# tell the handler to use this format -console.setFormatter(formatter) -logging.getLogger('').addHandler(console) -log=logging.getLogger('') - -logging.info("\nLogging started") - -class TestBibleManager: - log=logging.getLogger("testBibleMgr") - def setup_class(self): - log.debug("\n.......Register BM") - self.bm = BibleManager() - - def testGetBibles(self): - log.debug( "\n.......testGetBibles") - # make sure the shuffled sequence does not lose any elements - b = self.bm.getBibles() - for b1 in b: - log.debug( b1) - assert(b1 in b) - - def testGetBibleBooks(self): - log.debug( "\n.......testGetBibleBooks") - c = self.bm.getBibleBooks("asv") - for c1 in c: - log.debug( c1) - assert(c1 in c) - - def testGetBookChapterCount(self): - log.debug( "\n.......testGetBookChapterCount") - assert(self.bm.getBookChapterCount("asv","Matthew")[0] == 28) - - def testGetBookVerseCount(self): - log.debug( "\n.......testGetBookVerseCount") - assert(self.bm.getBookVerseCount("asv","Genesis", 1)[0] == 31) - assert(self.bm.getBookVerseCount("TheMessage","Genesis", 2)[0] == 25) - assert(self.bm.getBookVerseCount("asv","Matthew", 1)[0] == 25) - assert(self.bm.getBookVerseCount("TheMessage","Revelation", 1)[0] == 20) - - def testGetVerseText(self): - log.debug( "\n.......testGetVerseText") - #c = self.bm.getVerseText("TheMessage",'Genesis',1,2,1) - #log.debug( c ) - #c = self.bm.getVerseText('NIV','Genesis',1,1,2) - #log.debug( c ) - c = self.bm.getVerseText('asv','Genesis',10,1,20) - log.debug( c ) - c = self.bm.getVerseText('TheMessage','Genesis',10,1,20) - log.debug( c ) - c = self.bm.getVerseText('asv','Revelation',10,1,20) - log.debug( c ) - c = self.bm.getVersesFromText("asv", "Jesus wept") - log.debug( c ) - c = self.bm.getVersesFromText("TheMessage", "Jesus wept") - log.debug( c ) - diff --git a/openlp/plugins/biblemanager/test/test_bibleManagerCSV.py b/openlp/plugins/biblemanager/test/test_bibleManagerCSV.py deleted file mode 100644 index 03d8ea7b7..000000000 --- a/openlp/plugins/biblemanager/test/test_bibleManagerCSV.py +++ /dev/null @@ -1,61 +0,0 @@ -""" -OpenLP - Open Source Lyrics Projection -Copyright (c) 2008 Raoul Snyman -Portions copyright (c) 2008 Martin Thompson, Tim Bentley - -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 -""" - -import random -import unittest - -import os, os.path -import sys -mypath=os.path.split(os.path.abspath(__file__))[0] -sys.path.insert(0,(os.path.join(mypath, '..', '..','..','..'))) - -from openlp.plugins.bibles.lib.biblemanager import BibleManager -from openlp.utils import ConfigHelper - -import logging -logging.basicConfig(level=logging.DEBUG, - format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', - datefmt='%m-%d %H:%M', - filename='plugins.log', - filemode='w') - -console=logging.StreamHandler() -# set a format which is simpler for console use -formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') -# tell the handler to use this format -console.setFormatter(formatter) -logging.getLogger('').addHandler(console) -log=logging.getLogger('') - -logging.info("\nLogging started") - -class TestBibleManager: - log=logging.getLogger("testBibleMgr") - def setup_class(self): - log.debug("\n.......Register BM") - self.bm = BibleManager() - - def testRegisterCSVBibleFiles(self): - # Register a bible from files - log.debug("\n.......testRegisterBibleFiles") - self.bm.registerCSVFileBible("TheMessage",'biblebooks_msg_short.csv','bibleverses_msg_short.csv') - self.bm.registerCSVFileBible("NIV",'biblebooks_niv_short.csv','bibleverses_niv_short.csv') - b = self.bm.getBibles() - for b1 in b: - log.debug( b1) - assert(b1 in b) diff --git a/openlp/plugins/biblemanager/test/test_bibleManagerOSIS.py b/openlp/plugins/biblemanager/test/test_bibleManagerOSIS.py deleted file mode 100644 index 8689f9a76..000000000 --- a/openlp/plugins/biblemanager/test/test_bibleManagerOSIS.py +++ /dev/null @@ -1,60 +0,0 @@ -""" -OpenLP - Open Source Lyrics Projection -Copyright (c) 2008 Raoul Snyman -Portions copyright (c) 2008 Martin Thompson, Tim Bentley - -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 -""" - -import random -import unittest - -import os, os.path -import sys -mypath=os.path.split(os.path.abspath(__file__))[0] -sys.path.insert(0,(os.path.join(mypath, '..', '..','..','..'))) - -from openlp.plugins.bibles.lib.biblemanager import BibleManager -from openlp.utils import ConfigHelper - -import logging -logging.basicConfig(level=logging.DEBUG, - format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', - datefmt='%m-%d %H:%M', - filename='plugins.log', - filemode='w') - -console=logging.StreamHandler() -# set a format which is simpler for console use -formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') -# tell the handler to use this format -console.setFormatter(formatter) -logging.getLogger('').addHandler(console) -log=logging.getLogger('') - -logging.info("\nLogging started") - -class TestBibleManager: - log=logging.getLogger("testBibleMgr") - def setup_class(self): - log.debug("\n.......Register BM") - self.bm = BibleManager() - - def testRegisterOSISBibleFiles(self): - # Register a bible from files - log.debug("\n.......testRegisterOSISBibleFiles") - self.bm.registerOSISFileBible("asv",'asv.osis') - b = self.bm.getBibles() - for b1 in b: - log.debug( b1) - assert(b1 in b)