Skip to content

Commit

Permalink
Updated the tresult with info/err message Juniper#393
Browse files Browse the repository at this point in the history
Fixed Juniper#327
Fixed Juniper#330 commented out deletion test results
  • Loading branch information
chidanandpujar committed Jul 17, 2024
1 parent 2d486a8 commit 59d4e77
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/jnpr/jsnapy/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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 ]' % (
Expand All @@ -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
Expand Down

0 comments on commit 59d4e77

Please sign in to comment.