Esempio n. 1
0
def test_get_feed(fx_opener):
    result = get_feed('http://vio.atomtest.com/feed/atom')
    feed = result.feed
    assert feed.title.value == 'Atom Test'
    assert len(feed.entries) == 2
    assert result.hints is None
    assert result.icon_url is not None
Esempio n. 2
0
def test_get_feed(fx_opener):
    result = get_feed('http://vio.atomtest.com/feed/atom')
    feed = result.feed
    assert feed.title.value == 'Atom Test'
    assert len(feed.entries) == 2
    assert result.hints is None
    assert result.icon_url is not None
Esempio n. 3
0
def test_get_feed():
    my_opener = urllib2.build_opener(TestHTTPHandler)
    urllib2.install_opener(my_opener)
    result = get_feed('http://vio.atomtest.com/feed/atom')
    feed = result.feed
    assert feed.title.value == 'Atom Test'
    assert len(feed.entries) == 2
    assert result.hints is None
    assert result.icon_url is not None
Esempio n. 4
0
def test_get_feed():
    my_opener = urllib2.build_opener(TestHTTPHandler)
    urllib2.install_opener(my_opener)
    result = get_feed('http://vio.atomtest.com/feed/atom')
    feed = result.feed
    assert feed.title.value == 'Atom Test'
    assert len(feed.entries) == 2
    assert result.hints is None
    assert result.icon_url is not None
Esempio n. 5
0
def test_get_feed_timeout(fx_opener):
    start = time.time()
    with raises(CrawlError):
        get_feed('http://unreachable.timeouttest.earthreader.org/',
                 timeout=1)
    assert time.time() - start < 2
Esempio n. 6
0
def test_get_feed_timeout(fx_opener):
    start = time.time()
    with raises(CrawlError):
        get_feed('http://unreachable.timeouttest.earthreader.org/', timeout=1)
    assert time.time() - start < 2