meta: use pathlib to join paths in class Index

This commit moves the joining of path fragements from f-strings
to pathlib and simplifies some of the map/filter/lambda expressions
into more standard list comprehensions.
This commit is contained in:
Michael Vogt 2024-10-16 10:28:54 +02:00 committed by Simon de Vlieger
parent 8f7a3d7234
commit 55106056c8
2 changed files with 22 additions and 17 deletions

View file

@ -272,9 +272,14 @@ class TestDescriptions(unittest.TestCase):
modules += [(klass, module) for module in mods]
self.assertTrue(modules)
assert "org.osbuild.noop" in [m[1] for m in modules]
for module in modules:
klass, name = module
assert isinstance(name, str)
assert not name.endswith(".meta.json")
assert os.path.dirname(name) == ""
try:
info = osbuild.meta.ModuleInfo.load(os.curdir, klass, name)
schema = osbuild.meta.Schema(info.get_schema(version), name)