Skip to content

Commit b0cc74d

Browse files
Fix YAML test expression parser
1 parent 1a0dae5 commit b0cc74d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test_elasticsearch/test_server/test_rest_api_spec.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,11 +432,17 @@ def _lookup(self, path):
432432
step = int(step)
433433
assert isinstance(value, list)
434434
assert len(value) > step
435+
value = value[step]
435436
elif step == "_arbitrary_key_":
436437
return list(value.keys())[0]
437-
else:
438+
elif (
439+
isinstance(step, string_types)
440+
and isinstance(value, dict)
441+
):
438442
assert step in value
439-
value = value[step]
443+
value = value[step]
444+
else:
445+
value = step
440446
return value
441447

442448
def _feature_enabled(self, name):

0 commit comments

Comments
 (0)