From 59d4e771d7872800d13e7ce362e2f6e0eaa76344 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Wed, 17 Jul 2024 12:45:16 +0530 Subject: [PATCH] Updated the tresult with info/err message #393 Fixed #327 Fixed #330 commented out deletion test results --- lib/jnpr/jsnapy/operator.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/jnpr/jsnapy/operator.py b/lib/jnpr/jsnapy/operator.py index c13b5a4..d775fbb 100755 --- a/lib/jnpr/jsnapy/operator.py +++ b/lib/jnpr/jsnapy/operator.py @@ -40,7 +40,6 @@ def testname_results(self): test["command"] = cmd testname_result_dict.setdefault(test["test_name"], []) testname_result_dict[test["test_name"]].append(test) - # del test["test_name"] return testname_result_dict def define_operator( @@ -118,12 +117,12 @@ def _print_result(self, testmssg, result): colorama.Fore.GREEN + "PASS | " + testmssg, extra=self.log_detail ) - def _print_mssg(self, testmssg, result): + def _print_msg(self, testmssg, result): if result is False: self.logger_testop.info( colorama.Fore.RED + "FAIL | " + testmssg, extra=self.log_detail ) - elif result is True: + else: self.logger_testop.info( colorama.Fore.GREEN + "PASS | " + testmssg, extra=self.log_detail ) @@ -430,7 +429,7 @@ def exists( % (element, x_path, count_pass, count_fail) ) self._print_result(msg, res) - self._print_mssg(err_mssg, res) + self._print_msg(err_mssg, res) tresult["err"] = err_mssg # Updating the user specified err message elif res is True: msg = 'All "%s" exists at xpath "%s" [ %d value matched ]' % ( @@ -439,7 +438,7 @@ def exists( count_pass, ) self._print_result(msg, res) - self._print_mssg(info_mssg, res) + self._print_msg(info_mssg, res) tresult["info"] = info_mssg # Updating the user specified info message # tresult['info'] = info_mssg