bdd: new step variant 'result contains in field'

This replaces the + notation for recursing into result dictionaries.
This commit is contained in:
Sarah Hoffmann
2023-03-09 19:31:21 +01:00
parent 556bb2386d
commit e42c1c9c7a
3 changed files with 23 additions and 36 deletions

View File

@@ -264,12 +264,12 @@ def check_header_no_attr(context, neg, attrs):
'absent' if neg else 'present')
@then(u'results contain')
def step_impl(context):
@then(u'results contain(?: in field (?P<field>.*))?')
def step_impl(context, field):
context.execute_steps("then at least 1 result is returned")
for line in context.table:
context.response.match_row(line, context=context)
context.response.match_row(line, context=context, field=field)
@then(u'result (?P<lid>\d+ )?has (?P<neg>not )?attributes (?P<attrs>.*)')