From 2c32daedcbe7c75a84e132dfa7f00444c0c27019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Abdelkader=20Mart=C3=ADnez=20P=C3=A9rez?= Date: Mon, 18 Nov 2019 10:31:00 +0100 Subject: [PATCH] Default value in case there is no header --- spec/test/features/steps/steps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/test/features/steps/steps.py b/spec/test/features/steps/steps.py index 3c968ad..4fc6ffb 100644 --- a/spec/test/features/steps/steps.py +++ b/spec/test/features/steps/steps.py @@ -187,7 +187,7 @@ def step_impl(context, code): @then('the response header "{header_name}" contains "{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}')