Commit 634004aa authored by Łukasz Nowak's avatar Łukasz Nowak

playbook: Avoid exception during assertion

headers['Location'] might not exists, so get it with fallback to
nothing.
parent d96e1b04
......@@ -22,7 +22,7 @@ class TestSiteHttp(unittest.TestCase):
is_redirect=result.is_redirect,
is_permanent_redirect=result.is_permanent_redirect,
status_code=result.status_code,
location=result.headers['Location']
location=result.headers.get('Location')
),
dict(
ok=True,
......@@ -45,7 +45,7 @@ class TestSiteHttp(unittest.TestCase):
is_redirect=result.is_redirect,
is_permanent_redirect=result.is_permanent_redirect,
status_code=result.status_code,
location=result.headers['Location']
location=result.headers.get('Location')
),
dict(
ok=True,
......
......@@ -38,7 +38,7 @@ class TestSiteHttps(unittest.TestCase):
is_redirect=result.is_redirect,
is_permanent_redirect=result.is_permanent_redirect,
status_code=result.status_code,
location=result.headers['Location']
location=result.headers.get('Location')
),
dict(
ok=True,
......@@ -64,7 +64,7 @@ class TestSiteHttps(unittest.TestCase):
is_redirect=result.is_redirect,
is_permanent_redirect=result.is_permanent_redirect,
status_code=result.status_code,
location=result.headers['Location']
location=result.headers.get('Location')
),
dict(
ok=True,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment