A completely empty config is a valid config
This commit is contained in:
2
tests.py
2
tests.py
@ -73,7 +73,7 @@ def main():
|
||||
for fn in glob.glob(pattern):
|
||||
tests = tests + 1
|
||||
unittest, cfg = load_unittest(fn)
|
||||
if not unittest or not cfg:
|
||||
if not unittest:
|
||||
errors = errors + 1
|
||||
continue
|
||||
|
||||
|
6
unittest/correct-empty.yaml
Normal file
6
unittest/correct-empty.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
test:
|
||||
description: "A completely empty config file is, ironically, correct"
|
||||
errors:
|
||||
count: 0
|
||||
---
|
||||
|
@ -74,6 +74,9 @@ class Validator(object):
|
||||
def validate(self, yaml):
|
||||
ret_rv = True
|
||||
ret_msgs = []
|
||||
if not yaml:
|
||||
return ret_rv, ret_msgs
|
||||
|
||||
if self.schema:
|
||||
try:
|
||||
self.logger.debug("Validating against schema %s" % self.schema)
|
||||
|
Reference in New Issue
Block a user