fix missing parent in import and add unit test
svn: r9320
This commit is contained in:
parent
60fc844167
commit
dd9e15b43d
@ -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
|
||||
|
||||
|
32
src/GrampsDbUtils/test/_GrampsDbWRFactories_test.py
Normal file
32
src/GrampsDbUtils/test/_GrampsDbWRFactories_test.py
Normal 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===
|
Loading…
Reference in New Issue
Block a user