示例#1
0
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()
示例#2
0
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()
示例#3
0
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()
示例#4
0
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()
示例#5
0
def given_i_go_to_group1(step, url):
    world.get_url(url)
示例#6
0
def given_i_navigate_to_group1(step, url):
    world.get_url(url)
示例#7
0
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))
示例#8
0
def given_i_go_to_group1(step, url):
    world.get_url(url)
示例#9
0
def given_i_navigate_to_group1(step, url):
    world.get_url(url)
示例#10
0
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))