config: Improve config validation for anyOf and oneOf
Instead of just saying that there is a problem, give all possible reasons. JIRA: COMPOSE-3636 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
acd3c19618
commit
4e59c7595e
2 changed files with 10 additions and 3 deletions
|
|
@ -270,9 +270,13 @@ class OSBSThreadTest(helpers.PungiTestCase):
|
|||
config['osbs'] = {
|
||||
'^Server$': cfg
|
||||
}
|
||||
self.assertEqual(
|
||||
(['Failed validation in osbs.^Server$: %r is not valid under any of the given schemas' % cfg], []),
|
||||
checks.validate(config, offline=True))
|
||||
errors, warnings = checks.validate(config, offline=True)
|
||||
self.assertIn(
|
||||
"Failed validation in osbs.^Server$: %r is not valid under any of the given schemas" % cfg,
|
||||
errors,
|
||||
)
|
||||
self.assertIn(" Possible reason: %r is a required property" % key, errors)
|
||||
self.assertEqual([], warnings)
|
||||
|
||||
@mock.patch('pungi.phases.osbs.kojiwrapper.KojiWrapper')
|
||||
def test_minimal_run(self, KojiWrapper):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue