Passed
Pull Request — master (#19)
by Joe
01:56
created

sites.step_impl()   A

Complexity

Conditions 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
import os
2
3
import requests
4
from behave import when, then
5
6
7
ALT_DOMAIN = os.environ.get('ALT_DOMAIN', 'butt.com')
8
9
10
@when(u'I go to the site on a different domain')
11
def step_impl(context):
12
    context.response = requests.get(
13
        context.base_url,
14
        headers={'Host': ALT_DOMAIN},
15
    )
16
17
18
@then(u'the request should succeed')
19
def step_impl(context):
20
    assert context.response.ok
21