コード例 #1
0
def test_thumbnail():
    r = Request('intitle:tale+intitle:cities')
    resp = r.get()
    href = None
    for e in resp.entries:
        p = e.thumbnail
        if p is not None and 'http' in p:
            href = p
    assert href
コード例 #2
0
def test_description():
    r = Request('intitle:tale+intitle:cities')
    resp = r.get()
    found_description = False
    for e in resp.entries:
        p = e.description
        if p is not None and p != '':
            found_description = True
    assert found_description
コード例 #3
0
def test_pages():
    r = Request('intitle:tale+intitle:cities')
    resp = r.get()
    found_pages = False
    for e in resp.entries:
        p = e.pages
        if p is not None and p != '':
            found_pages = True
    assert found_pages
コード例 #4
0
def test_viewability():
    r = Request('intitle:tale+intitle:cities')
    resp = r.get()
    e = resp.entries[0]
    assert_true(e.viewability)
コード例 #5
0
def test_info():
    r = Request('intitle:tale+intitle:cities')
    resp = r.get()
    e = resp.entries[0]
    assert_true('http' in e.info)
コード例 #6
0
def test_query():
    r = Request('intitle:pride+intitle:prejudice')
    assert r
    resp = r.get()
    assert resp
コード例 #7
0
def test_entries():
    r = Request('intitle:tale+intitle:cities')
    resp = r.get()
    assert_true(len(resp.entries) > 0)
コード例 #8
0
def test_title():
    r = Request('intitle:pride+intitle:prejudice')
    resp = r.get()
    as_text = etree.tostring(resp.tree)
    assert 'Pride' in as_text
    assert 'Jane Austen' in as_text