Default value in case there is no header

This commit is contained in:
Roberto Abdelkader Martínez Pérez
2019-11-18 10:31:00 +01:00
committed by GitHub
parent 402bbf00d7
commit 2c32daedcb
+1 -1
View File
@@ -187,7 +187,7 @@ def step_impl(context, code):
@then('the response header "{header_name}" contains "{value}"') @then('the response header "{header_name}" contains "{value}"')
def step_impl(context, header_name, value): def step_impl(context, header_name, value):
assert context.response.headers.get(header_name).split(';')[0] == value, f"Got {context.response.headers.get(header_name)} instead" assert context.response.headers.get(header_name, "").split(';')[0] == value, f"Got {context.response.headers.get(header_name)} instead"
@then('the testing response header {header_name} contains {value}') @then('the testing response header {header_name} contains {value}')