A completely empty config is a valid config

This commit is contained in:
Pim van Pelt
2022-03-15 20:52:09 +00:00
parent c5872880fe
commit 6d3de72c00
3 changed files with 10 additions and 1 deletions

View File

@ -73,7 +73,7 @@ def main():
for fn in glob.glob(pattern): for fn in glob.glob(pattern):
tests = tests + 1 tests = tests + 1
unittest, cfg = load_unittest(fn) unittest, cfg = load_unittest(fn)
if not unittest or not cfg: if not unittest:
errors = errors + 1 errors = errors + 1
continue continue

View File

@ -0,0 +1,6 @@
test:
description: "A completely empty config file is, ironically, correct"
errors:
count: 0
---

View File

@ -74,6 +74,9 @@ class Validator(object):
def validate(self, yaml): def validate(self, yaml):
ret_rv = True ret_rv = True
ret_msgs = [] ret_msgs = []
if not yaml:
return ret_rv, ret_msgs
if self.schema: if self.schema:
try: try:
self.logger.debug("Validating against schema %s" % self.schema) self.logger.debug("Validating against schema %s" % self.schema)