test/osbuild: use new list_modules_for_class
Convert our custom code to list modules to the new ModuleInfo method list_modules_for_class that does the same thing. This is then indeed also testing that new function.
This commit is contained in:
parent
dd00c4f478
commit
131d0264a8
1 changed files with 7 additions and 4 deletions
|
|
@ -78,11 +78,14 @@ class TestDescriptions(unittest.TestCase):
|
|||
})
|
||||
|
||||
def test_moduleinfo(self):
|
||||
def list_modules(base, klass):
|
||||
return [(klass, f) for f in os.listdir(base) if f.startswith("org.osbuild")]
|
||||
index = osbuild.meta.Index(os.curdir)
|
||||
|
||||
modules = list_modules("stages", "Stage")
|
||||
modules += list_modules("assemblers", "Assembler")
|
||||
modules = []
|
||||
for klass in ("Stage", "Assembler"):
|
||||
mods = index.list_modules_for_class(klass)
|
||||
modules += [(klass, module) for module in mods]
|
||||
|
||||
self.assertTrue(modules)
|
||||
|
||||
for module in modules:
|
||||
klass, name = module
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue