accept validations.yml without tests and validations, to simply run and log trace
This commit is contained in:
parent
793f51be69
commit
ded9226e2a
@ -62,16 +62,17 @@ for test_name in [name for name in os.listdir(tests_dir) if os.path.isdir(os.pat
|
||||
# Run validations
|
||||
with open(validation_file, 'r') as f:
|
||||
validations = load(f)
|
||||
for k in validations.keys():
|
||||
# Identify checker class
|
||||
name = k.title().replace("_","")+"Checker"
|
||||
klass= globals()[name]
|
||||
# instantiate checker with validations and test_name
|
||||
checker = klass(validations, test_name, destDir)
|
||||
if checker.check():
|
||||
print checker.logs
|
||||
else:
|
||||
print checker.logs
|
||||
if validations!=None:
|
||||
for k in validations.keys():
|
||||
# Identify checker class
|
||||
name = k.title().replace("_","")+"Checker"
|
||||
klass= globals()[name]
|
||||
# instantiate checker with validations and test_name
|
||||
checker = klass(validations, test_name, destDir)
|
||||
if checker.check():
|
||||
print checker.logs
|
||||
else:
|
||||
print checker.logs
|
||||
|
||||
|
||||
|
||||
|
@ -141,16 +141,17 @@ class Checker:
|
||||
def check(self):
|
||||
is_ok = True
|
||||
self.logs=self.test_id+"\n"
|
||||
for test in self.yml:
|
||||
name=test["test"].title().replace("_","")+"Test"
|
||||
klass = globals()[name]
|
||||
r = klass(test, self.trace)
|
||||
if r.validate():
|
||||
self.logs = self.logs + " *" + self.test_id + " " + r.name() + " SUCCESS\n"
|
||||
self.logs = self.logs + r.logs
|
||||
else:
|
||||
self.logs = self.logs + " *" + self.test_id + " " + r.name() + " FAIL\n"
|
||||
self.logs = self.logs + r.logs
|
||||
if self.yml!=None:
|
||||
for test in self.yml:
|
||||
name=test["test"].title().replace("_","")+"Test"
|
||||
klass = globals()[name]
|
||||
r = klass(test, self.trace)
|
||||
if r.validate():
|
||||
self.logs = self.logs + " *" + self.test_id + " " + r.name() + " SUCCESS\n"
|
||||
self.logs = self.logs + r.logs
|
||||
else:
|
||||
self.logs = self.logs + " *" + self.test_id + " " + r.name() + " FAIL\n"
|
||||
self.logs = self.logs + r.logs
|
||||
|
||||
# Runs tests based on tcptrace
|
||||
# It (in the method inherited from its parent class) instanciates the ...Test class passing it the TcptraceData instance
|
||||
|
Loading…
Reference in New Issue
Block a user