Skip to content

Commit f0fd1bb

Browse files
Matthew Hardwickjirikuncar
andauthored
Add a length check to BDD tooling (#82)
Co-authored-by: Jiri Kuncar <[email protected]>
1 parent f2478e2 commit f0fd1bb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,12 @@ def expect_equal_value(api_request, fixtures, response_path, fixture_path):
407407
assert fixture_value == response_value
408408

409409

410+
@then(parsers.parse('the response "{response_path}" has length {fixture_length:d}'))
411+
def expect_equal_value(api_request, fixtures, response_path, fixture_length):
412+
response_value = glom(api_request["response"][0], response_path)
413+
assert fixture_length == len(response_value)
414+
415+
410416
@then(parsers.parse('the response "{response_path}" is false'))
411417
def expect_false(api_request, response_path):
412418
response_value = glom(api_request["response"][0], response_path)

0 commit comments

Comments
 (0)