Esempio n. 1
0
def test_linkset():
    links = parselinks("""
        <a href="http://something/pkg-1.2.tar.gz"/>
        <a href="http://something/pkg-1.2dev1.zip"/>
        <a href="http://something/pkg-1.2dev2.zip"/>
    """, "http://something")
    ls = LinkSet(links)
    link = ls.getnewestversion("pkg")
    assert URL(link.url).basename == "pkg-1.2.tar.gz"
Esempio n. 2
0
def test_linkset():
    links = parselinks("""
        <a href="http://something/pkg-1.2.tar.gz"/>
        <a href="http://something/pkg-1.2dev1.zip"/>
        <a href="http://something/pkg-1.2dev2.zip"/>
    """, "http://something")
    ls = LinkSet(links)
    link = ls.getnewestversion("pkg")
    assert URL(link.url).basename == "pkg-1.2.tar.gz"
Esempio n. 3
0
def test_parselinks():
    content = """<html><a href="href" rel="rel">text</a></html>"""
    link = parselinks(content, "http://root")[0]
    assert link.url == "http://root/href"
Esempio n. 4
0
def test_parselinks():
    content = """<html><a href="href" rel="rel">text</a></html>"""
    link = parselinks(content, "http://root")[0]
    assert link.url == "http://root/href"