Skip to content

Commit

Permalink
Fixed yaml test runner (#696)
Browse files Browse the repository at this point in the history
Signed-off-by: saimedhi <saimedhi@amazon.com>
  • Loading branch information
saimedhi committed Mar 16, 2024
1 parent d36a882 commit b2a1796
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test_opensearchpy/test_server/test_rest_api_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,10 @@ def run_match(self, action: Any) -> None:

if (
isinstance(expected, str)
and expected.startswith("/")
and expected.endswith("/")
and expected.strip().startswith("/")
and expected.strip().endswith("/")
):
expected = re.compile(expected[1:-1], re.VERBOSE | re.MULTILINE)
expected = re.compile(expected.strip()[1:-1], re.VERBOSE | re.MULTILINE)
assert expected.search(value), "%r does not match %r" % (
value,
expected,
Expand Down Expand Up @@ -417,9 +417,7 @@ def _resolve(self, value: Any) -> Any:
value = value.replace(key_replace, v)
break

if isinstance(value, string_types):
value = value.strip()
elif isinstance(value, dict):
if isinstance(value, dict):
value = dict((k, self._resolve(v)) for (k, v) in value.items())
elif isinstance(value, list):
value = list(map(self._resolve, value))
Expand Down

0 comments on commit b2a1796

Please sign in to comment.