bdd: Wait for request with "... should be loaded".

Hopefully makes things less prone to race conditions.
This commit is contained in:
Florian Bruhin 2015-11-17 06:41:58 +01:00
parent 779df4c08e
commit 71134f97e3

View File

@ -98,8 +98,7 @@ def wait_for_message(quteproc, httpbin, category, message):
@bdd.then(bdd.parsers.parse("{path} should be loaded")) @bdd.then(bdd.parsers.parse("{path} should be loaded"))
def path_should_be_loaded(httpbin, path): def path_should_be_loaded(httpbin, path):
requests = httpbin.get_requests() httpbin.wait_for(verb='GET', path='/' + path)
assert requests[-1] == httpbin.ExpectedRequest('GET', '/' + path)
@bdd.then(bdd.parsers.parse("The requests should be:\n{pages}")) @bdd.then(bdd.parsers.parse("The requests should be:\n{pages}"))