handle exceptions
This commit is contained in:
parent
9617cad4a0
commit
83788f5c08
@ -71,11 +71,14 @@ class TcptraceTest:
|
|||||||
klass_name=val["name"].title().replace("_","")+"Validation"
|
klass_name=val["name"].title().replace("_","")+"Validation"
|
||||||
tester_klass=globals()[klass_name]
|
tester_klass=globals()[klass_name]
|
||||||
tester = tester_klass(val)
|
tester = tester_klass(val)
|
||||||
|
try:
|
||||||
if tester.validate(tested_value):
|
if tester.validate(tested_value):
|
||||||
self.logs=self.logs+ ("" if self.logs=="" else "\n ")+ " -" +tester.name()+" OK\n"
|
self.logs=self.logs+ ("" if self.logs=="" else "\n ")+ " -" +tester.name()+" OK\n"
|
||||||
else:
|
else:
|
||||||
self.logs=self.logs+ ("" if self.logs=="" else "\n ")+ " -" +tester.name()+" FAILS "+ val["desc"] +"\n"
|
self.logs=self.logs+ ("" if self.logs=="" else "\n ")+ " -" +tester.name()+" FAILS "+ val["desc"] +"\n"
|
||||||
is_ok = False
|
is_ok = False
|
||||||
|
except Exception as e:
|
||||||
|
self.logs=self.logs+ ("" if self.logs=="" else "\n ")+ " -" +tester.name()+" FAILS (EXCEPTION:"+ str(e) + ") "+ val["desc"] +"\n"
|
||||||
return is_ok
|
return is_ok
|
||||||
def name(self):
|
def name(self):
|
||||||
return self.__class__.__name__
|
return self.__class__.__name__
|
||||||
|
Loading…
Reference in New Issue
Block a user