fix missing parent in import and add unit test

svn: r9320
This commit is contained in:
James G Sack 2007-11-08 02:41:10 +00:00
parent 60fc844167
commit dd9e15b43d
2 changed files with 33 additions and 1 deletions

View File

@ -35,7 +35,7 @@ from gettext import gettext as _
# Gramps Modules
#
#-------------------------------------------------------------------------
from _GrampsBSDDB import GrampsBSDDB
from GrampsDb._GrampsBSDDB import GrampsBSDDB
from QuestionDialog import ErrorDialog
from gen.utils import db_copy

View File

@ -0,0 +1,32 @@
#!/usr/bin/env python
import unittest
from test import test_util as tu
tu.path_append_parent()
###
class Test1(unittest.TestCase):
"""Test imports which are buried within functions
otherwise they may not get timely test coverage
NB: if any test fails, check imports within that module
"""
def test1a_buried_imports(s):
ilist = (
"_WriteGrdb",
"_WriteXML",
"_WriteGedcom",
"_ReadXML",
"_ReadGedcom",
)
for m in ilist:
try:
mod = __import__(m)
except ImportError:
mod = None
s.assertTrue(mod, "try import of module %r" % m)
if __name__ == "__main__":
unittest.main()
#===eof===