forked from openlp/openlp
Proper Unitest this time
bzr-revno: 33
This commit is contained in:
parent
fc913785b9
commit
681aa1d141
@ -1,3 +1,6 @@
|
|||||||
|
import random
|
||||||
|
import unittest
|
||||||
|
|
||||||
import os, os.path
|
import os, os.path
|
||||||
import sys
|
import sys
|
||||||
mypath=os.path.split(os.path.abspath(__file__))[0]
|
mypath=os.path.split(os.path.abspath(__file__))[0]
|
||||||
@ -5,18 +8,32 @@ sys.path.insert(0,(os.path.join(mypath, '..', '..','..')))
|
|||||||
|
|
||||||
from openlp.database.BibleManager import *
|
from openlp.database.BibleManager import *
|
||||||
|
|
||||||
bm = BibleManager()
|
class TestBibleManager(unittest.TestCase):
|
||||||
print bm
|
|
||||||
print bm.getBibles()
|
def setUp(self):
|
||||||
b = bm.getBibles()
|
self.bm = BibleManager()
|
||||||
|
|
||||||
|
def testGetBibles(self):
|
||||||
|
# make sure the shuffled sequence does not lose any elements
|
||||||
|
b = self.bm.getBibles()
|
||||||
for b1 in b:
|
for b1 in b:
|
||||||
print b1
|
print b1
|
||||||
print bm.getBibleBooks("NIV")
|
self.assert_(b1 in b)
|
||||||
c = bm.getBibleBooks("NIV")
|
|
||||||
|
def testGetBooks(self):
|
||||||
|
c = self.bm.getBibleBooks("NIV")
|
||||||
for c1 in c:
|
for c1 in c:
|
||||||
print c1
|
print c1
|
||||||
print bm.getBookVerseCount("NIV", "GEN", 1)
|
self.assert_(c1 in c)
|
||||||
print bm.getVerseText("NIV", "GEN",1,1,1)
|
|
||||||
c = bm.getVerseText("NIV","GEN",1,2,1)
|
def testGetBooks(self):
|
||||||
|
self.failUnless(self.bm.getBookVerseCount("NIV", "GEN", 1) == 28, "Wrong Book Count")
|
||||||
|
|
||||||
|
def testGetVerseText(self):
|
||||||
|
c = self.bm.getVerseText("NIV","GEN",1,2,1)
|
||||||
for c1 in c:
|
for c1 in c:
|
||||||
print c1
|
print c1
|
||||||
|
self.assert_(c1 in c)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
||||||
|
Loading…
Reference in New Issue
Block a user