From 94d20e89c2a21e3e98c8fd074391a72844d43a9c Mon Sep 17 00:00:00 2001 From: Sai Medhini Reddy Maryada <117196660+saimedhi@users.noreply.github.com> Date: Thu, 14 Mar 2024 11:05:39 -0700 Subject: [PATCH] Update test_rest_api_spec.py --- test_opensearchpy/test_server/test_rest_api_spec.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test_opensearchpy/test_server/test_rest_api_spec.py b/test_opensearchpy/test_server/test_rest_api_spec.py index da1f1b8f..47205cf4 100644 --- a/test_opensearchpy/test_server/test_rest_api_spec.py +++ b/test_opensearchpy/test_server/test_rest_api_spec.py @@ -373,6 +373,8 @@ def run_length(self, action: Any) -> None: def run_match(self, action: Any) -> None: for path, expected in action.items(): + print("expected @before", expected ) + print("path @before ", path) value = self._lookup(path) expected = self._resolve(expected) print("expected before", expected ) @@ -440,9 +442,12 @@ def _resolve(self, value: Any) -> Any: return value def _lookup(self, path: str) -> Any: + print("lookup printed path",path) # fetch the possibly nested value from last_response value: Any = self.last_response + print("lookup printed value1",value) if path == "$body": + print("lookup printed value2",value) return value path = path.replace(r"\.", "\1") step: Any @@ -461,10 +466,12 @@ def _lookup(self, path: str) -> Any: assert isinstance(value, list) assert len(value) > step elif step == "_arbitrary_key_": + print("lookup printed value3",list(value.keys())[0]) return list(value.keys())[0] else: assert step in value value = value[step] + print("lookup printed value4",value) return value def _feature_enabled(self, name: str) -> Any: @@ -472,6 +479,8 @@ def _feature_enabled(self, name: str) -> Any: def _assert_match_equals(self, a: Any, b: Any) -> None: # Handle for large floating points with 'E' + print("_assert_match_equals a", a) + print("_assert_match_equals b", b) if isinstance(b, string_types) and isinstance(a, float) and "e" in repr(a): a = repr(a).replace("e+", "E")