right key detection method for validation.yml

This commit is contained in:
Raphael Bauduin 2015-06-24 00:13:22 -07:00
parent d46e9fd9e2
commit 36d992c3ec

View File

@ -74,7 +74,7 @@ for test_name in [name for name in os.listdir(tests_dir) if os.path.isdir(os.pat
with open(validation_file, 'r') as f: with open(validation_file, 'r') as f:
validations = load(f) validations = load(f)
if validations!=None: if validations!=None:
if validations["checkers"]!=None: if "checkers" in validations:
for k in validations["checkers"].keys(): for k in validations["checkers"].keys():
# Identify checker class # Identify checker class
name = k.title().replace("_","")+"Checker" name = k.title().replace("_","")+"Checker"
@ -85,7 +85,7 @@ for test_name in [name for name in os.listdir(tests_dir) if os.path.isdir(os.pat
print checker.logs print checker.logs
else: else:
print checker.logs print checker.logs
if validations["aggregators"]!=None: if "aggregators" in validations:
for k in validations["aggregators"]: for k in validations["aggregators"]:
# Identify checker class # Identify checker class
name = k.title().replace("_","")+"Aggregator" name = k.title().replace("_","")+"Aggregator"