Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 4
0
def test_viewability():
    r = Request('intitle:tale+intitle:cities')
    resp = r.get()
    e = resp.entries[0]
    assert_true(e.viewability)
Ejemplo n.º 5
0
def test_info():
    r = Request('intitle:tale+intitle:cities')
    resp = r.get()
    e = resp.entries[0]
    assert_true('http' in e.info)
Ejemplo n.º 6
0
def test_query():
    r = Request('intitle:pride+intitle:prejudice')
    assert r
    resp = r.get()
    assert resp
Ejemplo n.º 7
0
def test_entries():
    r = Request('intitle:tale+intitle:cities')
    resp = r.get()
    assert_true(len(resp.entries) > 0)
Ejemplo n.º 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