Perform schema validation
Define a schema that we can pass to jsonschema to validate against the config a user has supplied. This will help catch a wide variety of common errors that occur. If the config does not pass schema validation then it raises an exception and prints out human readable reasons. Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
This commit is contained in:
parent
22b7ee42de
commit
da36ee7cbc
8 changed files with 175 additions and 75 deletions
|
|
@ -49,7 +49,6 @@ class ServiceTest(unittest.TestCase):
|
|||
Service('.__.', image='foo')
|
||||
|
||||
def test_project_validation(self):
|
||||
self.assertRaises(ConfigError, lambda: Service('bar'))
|
||||
self.assertRaises(ConfigError, lambda: Service(name='foo', project='>', image='foo'))
|
||||
|
||||
Service(name='foo', project='bar.bar__', image='foo')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue