bdd: Add check_header step.
This commit is contained in:
parent
76143574ef
commit
1e79aae231
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
@ -159,3 +160,15 @@ def no_crash():
|
|||||||
|
|
||||||
This is actually a NOP as a crash is already checked in the log."""
|
This is actually a NOP as a crash is already checked in the log."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@bdd.then(bdd.parsers.parse("the header {header} should be set to {value}"))
|
||||||
|
def check_header(quteproc, header, value):
|
||||||
|
"""Check if a given header is set correctly.
|
||||||
|
|
||||||
|
This assumes we're on the httpbin header page.
|
||||||
|
"""
|
||||||
|
content = quteproc.get_content()
|
||||||
|
data = json.loads(content)
|
||||||
|
print(data)
|
||||||
|
assert data['headers'][header] == value
|
||||||
|
Loading…
Reference in New Issue
Block a user