test/osbuild: also validate the schema of stages
Up until now it was verified that loading the `STAGE_OPTS` data works, i.e. that it contains valid JSON, but the schema itself was not verified. Use the new `Schema.check` method to do that.
This commit is contained in:
parent
9d08f4faf2
commit
26ca79ec25
1 changed files with 6 additions and 1 deletions
|
|
@ -87,7 +87,12 @@ class TestDescriptions(unittest.TestCase):
|
|||
for stage in stages:
|
||||
klass, name = stage
|
||||
try:
|
||||
osbuild.meta.StageInfo.load(os.curdir, klass, name)
|
||||
info = osbuild.meta.StageInfo.load(os.curdir, klass, name)
|
||||
schema = osbuild.meta.Schema(info.schema, name)
|
||||
res = schema.check()
|
||||
if not res:
|
||||
err = "\n ".join(str(e) for e in res)
|
||||
self.fail(str(res) + "\n " + err)
|
||||
except json.decoder.JSONDecodeError as e:
|
||||
msg = f"{klass} '{name}' has invalid STAGE_OPTS\n\t" + str(e)
|
||||
self.fail(msg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue