bdd: Fix assert in "The requests should be" step.

When we call get_requests() inside the assertion, it won't act the same when
reinterpreting it.
This commit is contained in:
Florian Bruhin 2015-11-09 07:38:34 +01:00
parent a05da2a956
commit 8aa29a2ba2

View File

@ -92,9 +92,10 @@ def path_should_be_loaded(httpbin, path):
@bdd.then(bdd.parsers.parse("The requests should be:\n{pages}"))
def list_of_loaded_pages(httpbin, pages):
requests = [httpbin.Request('GET', '/' + path.strip())
for path in pages.split('\n')]
assert httpbin.get_requests() == requests
expected_requests = [httpbin.Request('GET', '/' + path.strip())
for path in pages.split('\n')]
actual_requests = httpbin.get_requests()
assert actual_requests == expected_requests
@bdd.then(bdd.parsers.re(r'the (?P<category>error|message|warning) '