2 """Tests the import-safety of leaf cola modules"""
8 class ColaImportTest(unittest
.TestCase
):
9 """Stub class used to hold the generated tests"""
12 def _gen_test_method(themodule
):
13 def import_test(self
):
14 """This is not a docstring"""
15 mod
= __import__(themodule
)
20 for module
in """cola.git
23 cola.controllers.bookmark
24 cola.controllers.classic
25 cola.controllers.compare
26 cola.controllers.createbranch
28 cola.controllers.merge
29 cola.controllers.options
30 cola.controllers.remote
31 cola.controllers.repobrowser
32 cola.controllers.search
33 cola.controllers.selectcommits
34 cola.controllers.stash
40 cola.models.observable
41 cola.models.search""".split():
42 method
= _gen_test_method(module
)
43 method
.__doc
__ = 'Test that we can import %s' % module
44 methodname
= "test_" + module
.replace('.', '_')
45 setattr(ColaImportTest
, methodname
, method
)
48 if __name__
== '__main__':