Skip to content

Commit b2a1796

Browse files
authored
Fixed yaml test runner (opensearch-project#696)
Signed-off-by: saimedhi <saimedhi@amazon.com>
1 parent d36a882 commit b2a1796

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test_opensearchpy/test_server/test_rest_api_spec.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,10 @@ def run_match(self, action: Any) -> None:
371371

372372
if (
373373
isinstance(expected, str)
374-
and expected.startswith("/")
375-
and expected.endswith("/")
374+
and expected.strip().startswith("/")
375+
and expected.strip().endswith("/")
376376
):
377-
expected = re.compile(expected[1:-1], re.VERBOSE | re.MULTILINE)
377+
expected = re.compile(expected.strip()[1:-1], re.VERBOSE | re.MULTILINE)
378378
assert expected.search(value), "%r does not match %r" % (
379379
value,
380380
expected,
@@ -417,9 +417,7 @@ def _resolve(self, value: Any) -> Any:
417417
value = value.replace(key_replace, v)
418418
break
419419

420-
if isinstance(value, string_types):
421-
value = value.strip()
422-
elif isinstance(value, dict):
420+
if isinstance(value, dict):
423421
value = dict((k, self._resolve(v)) for (k, v) in value.items())
424422
elif isinstance(value, list):
425423
value = list(map(self._resolve, value))

0 commit comments

Comments
 (0)