def given_i_fetch_the_urls(step): urls = [django_url(i['url']) for i in step.hashes] for url in urls: http = world.get_url(url) world.statuses.append((url, http.code)) world.content_types.append((url, http.headers.dict['content-type'])) http.close()
def given_i_fetch_the_urls(step): urls = map(lambda i: django_url(i['url']), step.hashes) for url in urls: http = world.get_url(url) world.statuses.append((url, http.code)) world.content_types.append((url, http.headers['content-type'])) http.close()
def when_i_try_to_resolve_the_assets_provided_by_given_html(step): dom = lhtml.fromstring(world.last_response.read()) elements = dom.cssselect('link[href],script[src]') for e in elements: url = django_url(e.attrib.get('href', e.attrib.get('src'))) http = world.get_url(url) world.statuses.append((url, http.code)) world.content_types.append((url, http.headers['content-type'])) http.close()
def when_i_try_to_resolve_the_assets_provided_by_given_html(step): dom = lhtml.fromstring(world.last_response.read()) elements = dom.cssselect('link[href],script[src]') for e in elements: url = django_url(e.attrib.get('href', e.attrib.get('src'))) http = world.get_url(url) world.statuses.append((url, http.code)) world.content_types.append((url, http.headers.dict['content-type'])) http.close()
def given_i_go_to_group1(step, url): world.get_url(url)
def given_i_navigate_to_group1(step, url): world.get_url(url)
def then_i_see_that_requesting_group1_gets_group2(step, url, status): world.get_url(url) assert_equals(int(world.last_response.code), int(status))