Fix regression in examples checker. (#340)

When the example lists were changed from sets to lists that may contain 'None' values,
the examples checker should have been updated to filter them.
This was not covered by existing examples checker tests.

Testing: manual testing.
This commit is contained in:
marina-p 2021-09-08 14:12:53 -07:00 коммит произвёл GitHub
Родитель acee77f69c
Коммит 0597d3a2a2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -81,7 +81,7 @@ class ExamplesChecker(CheckerBase):
status_codes = {}
# Send new request for each body example
for example in request.examples.body_examples:
for example in filter(lambda x : x is not None, request.examples.body_examples):
blocks = example.get_blocks()
new_request = request.substitute_body(blocks)
if new_request:
@ -91,7 +91,7 @@ class ExamplesChecker(CheckerBase):
# Send new request for each query example.
# For now don't try to match these up with body examples.
# There will soon be IDs associated with the examples, so they can be matched.
for example in request.examples.query_examples:
for example in filter(lambda x : x is not None, request.examples.query_examples):
q_blocks = []
for idx, query in enumerate(example.param_list):
q_blocks += query.get_blocks()