2 """Tests the import-safety of leaf cola modules"""
10 class ColaImportTest(helper
.TestCase
):
11 """Stub class used to hold the generated tests"""
14 def _gen_test_method(themodule
):
15 def import_test(self
):
16 """This is not a docstring"""
17 mod
= __import__(themodule
)
22 for module
in """cola.git
25 cola.controllers.bookmark
26 cola.controllers.classic
27 cola.controllers.compare
28 cola.controllers.createbranch
30 cola.controllers.merge
31 cola.controllers.options
32 cola.controllers.remote
33 cola.controllers.repobrowser
34 cola.controllers.search
35 cola.controllers.selectcommits
36 cola.controllers.stash
42 cola.models.observable
43 cola.models.search""".split():
44 method
= _gen_test_method(module
)
45 method
.__doc
__ = 'Test that we can import %s' % module
46 methodname
= "test_" + module
.replace('.', '_')
47 setattr(ColaImportTest
, methodname
, method
)
50 if __name__
== '__main__':