Esempio n. 1
0
def test_get_links():
    soup = bs.to_soup(ex.LINKS)
    links = bs.get_links(soup, 'http://retrogames.com')
    assert links == ['http://retrogames.com', 'http://retrogames.com/games/elite', 'http://retrogames.com/games/commando']
    #
    links = bs.get_links(soup)
    assert links == ['http://retrogames.com', '/games/elite', '/games/commando']
Esempio n. 2
0
def test_get_links():
    soup = bs.to_soup(ex.LINKS)
    links = bs.get_links(soup, 'http://retrogames.com')
    assert links == [
        'http://retrogames.com', 'http://retrogames.com/games/elite',
        'http://retrogames.com/games/commando'
    ]
    #
    links = bs.get_links(soup)
    assert links == [
        'http://retrogames.com', '/games/elite', '/games/commando'
    ]
Esempio n. 3
0
def test_make_links_absolute():
    soup = bs.to_soup(ex.LINKS)
    soup = bs.make_links_absolute(soup, 'http://retrogames.com')
    #
    links = bs.get_links(soup)
    assert links == ['http://retrogames.com', 'http://retrogames.com/games/elite', 'http://retrogames.com/games/commando']
    
Esempio n. 4
0
def test_make_links_absolute():
    soup = bs.to_soup(ex.LINKS)
    soup = bs.make_links_absolute(soup, 'http://retrogames.com')
    #
    links = bs.get_links(soup)
    assert links == [
        'http://retrogames.com', 'http://retrogames.com/games/elite',
        'http://retrogames.com/games/commando'
    ]