From 984353232f21c1a8f3326b6841db28f5108b6671 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Thu, 6 Jun 2024 16:15:07 +0530 Subject: [PATCH 01/13] Updated the tresult with info/err message --- lib/jnpr/jsnapy/operator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/jnpr/jsnapy/operator.py b/lib/jnpr/jsnapy/operator.py index 9427ba7..3ecc0e4 100755 --- a/lib/jnpr/jsnapy/operator.py +++ b/lib/jnpr/jsnapy/operator.py @@ -420,6 +420,7 @@ def exists( % (element, x_path, count_pass, count_fail) ) self._print_result(msg, res) + tresult['err'] = err_mssg elif res is True: msg = 'All "%s" exists at xpath "%s" [ %d value matched ]' % ( element, @@ -427,6 +428,7 @@ def exists( count_pass, ) self._print_result(msg, res) + tresult['info'] = info_mssg # tresult['info'] = info_mssg # tresult['err'] = err_mssg From 985c7805f9f5ddaf814c9c2796819c63bc1c03b9 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Thu, 6 Jun 2024 16:18:09 +0530 Subject: [PATCH 02/13] Updated the tresult with info/err message --- lib/jnpr/jsnapy/operator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jnpr/jsnapy/operator.py b/lib/jnpr/jsnapy/operator.py index 3ecc0e4..9e5ae48 100755 --- a/lib/jnpr/jsnapy/operator.py +++ b/lib/jnpr/jsnapy/operator.py @@ -420,7 +420,7 @@ def exists( % (element, x_path, count_pass, count_fail) ) self._print_result(msg, res) - tresult['err'] = err_mssg + tresult['err'] = err_mssg # Updating the user specified err message elif res is True: msg = 'All "%s" exists at xpath "%s" [ %d value matched ]' % ( element, @@ -428,7 +428,7 @@ def exists( count_pass, ) self._print_result(msg, res) - tresult['info'] = info_mssg + tresult['info'] = info_mssg # Updating the user specified err message # tresult['info'] = info_mssg # tresult['err'] = err_mssg From 45588cdad6b4b367e3475ce68cd78e51e234c75b Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Thu, 6 Jun 2024 16:21:18 +0530 Subject: [PATCH 03/13] Updated the tresult with info/err message --- lib/jnpr/jsnapy/operator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jnpr/jsnapy/operator.py b/lib/jnpr/jsnapy/operator.py index 9e5ae48..e3017d6 100755 --- a/lib/jnpr/jsnapy/operator.py +++ b/lib/jnpr/jsnapy/operator.py @@ -428,7 +428,7 @@ def exists( count_pass, ) self._print_result(msg, res) - tresult['info'] = info_mssg # Updating the user specified err message + tresult['info'] = info_mssg # Updating the user specified info message # tresult['info'] = info_mssg # tresult['err'] = err_mssg From 3230f36271d61b7f78b74922ff0877df63b08c3b Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Thu, 6 Jun 2024 16:23:53 +0530 Subject: [PATCH 04/13] Updated the tresult with info/err message --- lib/jnpr/jsnapy/operator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jnpr/jsnapy/operator.py b/lib/jnpr/jsnapy/operator.py index e3017d6..af18b18 100755 --- a/lib/jnpr/jsnapy/operator.py +++ b/lib/jnpr/jsnapy/operator.py @@ -420,7 +420,7 @@ def exists( % (element, x_path, count_pass, count_fail) ) self._print_result(msg, res) - tresult['err'] = err_mssg # Updating the user specified err message + tresult["err"] = err_mssg # Updating the user specified err message elif res is True: msg = 'All "%s" exists at xpath "%s" [ %d value matched ]' % ( element, @@ -428,7 +428,7 @@ def exists( count_pass, ) self._print_result(msg, res) - tresult['info'] = info_mssg # Updating the user specified info message + tresult["info"] = info_mssg # Updating the user specified info message # tresult['info'] = info_mssg # tresult['err'] = err_mssg From 2960474016eaeeb56f0cb067ea256d7fec724009 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Thu, 6 Jun 2024 16:25:55 +0530 Subject: [PATCH 05/13] Updated the tresult with info/err message --- lib/jnpr/jsnapy/operator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jnpr/jsnapy/operator.py b/lib/jnpr/jsnapy/operator.py index af18b18..9cb73f4 100755 --- a/lib/jnpr/jsnapy/operator.py +++ b/lib/jnpr/jsnapy/operator.py @@ -420,7 +420,7 @@ def exists( % (element, x_path, count_pass, count_fail) ) self._print_result(msg, res) - tresult["err"] = err_mssg # Updating the user specified err message + tresult["err"] = err_mssg # Updating the user specified err message elif res is True: msg = 'All "%s" exists at xpath "%s" [ %d value matched ]' % ( element, @@ -428,7 +428,7 @@ def exists( count_pass, ) self._print_result(msg, res) - tresult["info"] = info_mssg # Updating the user specified info message + tresult["info"] = info_mssg # Updating the user specified info message # tresult['info'] = info_mssg # tresult['err'] = err_mssg From 44f1bd5cbb5b7fddd2b32195214e06b8227b69f6 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Thu, 6 Jun 2024 21:14:55 +0530 Subject: [PATCH 06/13] Updated the tresult with info/err message --- lib/jnpr/jsnapy/operator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/jnpr/jsnapy/operator.py b/lib/jnpr/jsnapy/operator.py index 9cb73f4..5b16ce4 100755 --- a/lib/jnpr/jsnapy/operator.py +++ b/lib/jnpr/jsnapy/operator.py @@ -420,6 +420,7 @@ def exists( % (element, x_path, count_pass, count_fail) ) self._print_result(msg, res) + self._print_result(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 ]' % ( @@ -428,6 +429,7 @@ def exists( count_pass, ) self._print_result(msg, res) + self._print_result(info_mssg, res) tresult["info"] = info_mssg # Updating the user specified info message # tresult['info'] = info_mssg From 7257cf442f4e1bf30c963b42ba98f91b6d405d8a Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Thu, 6 Jun 2024 21:32:09 +0530 Subject: [PATCH 07/13] Updated the tresult with info/err message --- lib/jnpr/jsnapy/operator.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/jnpr/jsnapy/operator.py b/lib/jnpr/jsnapy/operator.py index 5b16ce4..dd67ffd 100755 --- a/lib/jnpr/jsnapy/operator.py +++ b/lib/jnpr/jsnapy/operator.py @@ -117,6 +117,15 @@ def _print_result(self, testmssg, result): self.logger_testop.info( colorama.Fore.GREEN + "PASS | " + testmssg, extra=self.log_detail ) + def _print_mssg(self, testmssg, result): + if result is False: + self.logger_testop.info( + colorama.Fore.RED + "FAIL | " + testmssg, extra=self.log_detail + ) + elif result is True: + self.logger_testop.info( + colorama.Fore.GREEN + "PASS | " + testmssg, extra=self.log_detail + ) def print_testmssg(self, testname): """ @@ -420,7 +429,7 @@ def exists( % (element, x_path, count_pass, count_fail) ) self._print_result(msg, res) - self._print_result(err_mssg, res) + self._print_mssg(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 ]' % ( @@ -429,7 +438,7 @@ def exists( count_pass, ) self._print_result(msg, res) - self._print_result(info_mssg, res) + self._print_mssg(info_mssg, res) tresult["info"] = info_mssg # Updating the user specified info message # tresult['info'] = info_mssg From 739fca61ef3592fb1ad7cebbfe28a8dfedb7823d Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Thu, 6 Jun 2024 21:38:40 +0530 Subject: [PATCH 08/13] Updated the tresult with info/err message --- lib/jnpr/jsnapy/operator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jnpr/jsnapy/operator.py b/lib/jnpr/jsnapy/operator.py index dd67ffd..c0d641a 100755 --- a/lib/jnpr/jsnapy/operator.py +++ b/lib/jnpr/jsnapy/operator.py @@ -117,6 +117,7 @@ def _print_result(self, testmssg, result): self.logger_testop.info( colorama.Fore.GREEN + "PASS | " + testmssg, extra=self.log_detail ) + def _print_mssg(self, testmssg, result): if result is False: self.logger_testop.info( @@ -126,7 +127,6 @@ def _print_mssg(self, testmssg, result): self.logger_testop.info( colorama.Fore.GREEN + "PASS | " + testmssg, extra=self.log_detail ) - def print_testmssg(self, testname): """ Print info and error messages From 313bf715fcb2cb4a9222b9ce365f3fe7f009e63d Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Thu, 6 Jun 2024 21:41:47 +0530 Subject: [PATCH 09/13] Updated the tresult with info/err message --- lib/jnpr/jsnapy/operator.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/jnpr/jsnapy/operator.py b/lib/jnpr/jsnapy/operator.py index c0d641a..b73aae0 100755 --- a/lib/jnpr/jsnapy/operator.py +++ b/lib/jnpr/jsnapy/operator.py @@ -127,6 +127,7 @@ def _print_mssg(self, testmssg, result): self.logger_testop.info( colorama.Fore.GREEN + "PASS | " + testmssg, extra=self.log_detail ) + def print_testmssg(self, testname): """ Print info and error messages From 5ae3f9b3d99c0a83067c572d3b7fc57df9216426 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Wed, 12 Jun 2024 11:04:27 +0530 Subject: [PATCH 10/13] Updated the tresult with info/err message #393 Fixed #327 --- tools/jsnap2py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/jsnap2py b/tools/jsnap2py index 8baa9ba..860a6fd 100755 --- a/tools/jsnap2py +++ b/tools/jsnap2py @@ -27,7 +27,7 @@ def msg_change(x): data = (data[0],data[1][1:]) if data[0] in ['id', 'ID']: data = (data[0], int(data[1])-1) - msg = "{{%s_%s}}" % (data) + msg = "{{%s_%s}}" % (data) elif data[0] in ['PRE', 'POST']: msg = '{{%s["%s"]}}' % (data) else: @@ -120,7 +120,7 @@ else: '\$id\.\d|\$pre\s?/?\.?/\s?[\w-]+/?[\w-]*|\$post\s?/?\.?/\s?[\w-]+/?[\w-]*|,\s?\.{0,2}/?\.{0,2}/?[\w-]+/?[\w-]*/?[\w-]*', data.group(2), re.I) - inputs = map(msg_change, inputs) + inputs = list(map(msg_change, inputs)) to_format = re.search('"(.*?)"', obj.group(2)) if len(inputs) > 0: if to_format: From 6b719ec562006dc1841dc5f58cf7222c597b095d Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Wed, 12 Jun 2024 14:27:57 +0530 Subject: [PATCH 11/13] Updated the tresult with info/err message #393 Fixed #327 Fixed #330 commented out deletion test results --- lib/jnpr/jsnapy/operator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jnpr/jsnapy/operator.py b/lib/jnpr/jsnapy/operator.py index b73aae0..ddc5fc9 100755 --- a/lib/jnpr/jsnapy/operator.py +++ b/lib/jnpr/jsnapy/operator.py @@ -40,7 +40,7 @@ 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"] + #del test["test_name"] return testname_result_dict def define_operator( From 2d486a8b92def8e196d37a7b3c80cc12cc946905 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Wed, 12 Jun 2024 14:35:57 +0530 Subject: [PATCH 12/13] Updated the tresult with info/err message #393 Fixed #327 Fixed #330 commented out deletion test results --- lib/jnpr/jsnapy/operator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jnpr/jsnapy/operator.py b/lib/jnpr/jsnapy/operator.py index ddc5fc9..c13b5a4 100755 --- a/lib/jnpr/jsnapy/operator.py +++ b/lib/jnpr/jsnapy/operator.py @@ -40,7 +40,7 @@ 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"] + # del test["test_name"] return testname_result_dict def define_operator( From 59d4e771d7872800d13e7ce362e2f6e0eaa76344 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Wed, 17 Jul 2024 12:45:16 +0530 Subject: [PATCH 13/13] 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