diff options
author | Jannis Leidel <jannis@leidel.info> | 2012-02-16 21:09:00 +0100 |
---|---|---|
committer | Jannis Leidel <jannis@leidel.info> | 2012-02-16 21:09:00 +0100 |
commit | ee554dd82b8bc6ed9a3cf989b353126580fcc082 (patch) | |
tree | b0604f39ed465673316fe94ffa29046ed868aafc /tests/test_index.py | |
parent | 47f1b2c2b2523469e6107cb2ef325eb61fa8fcf1 (diff) | |
parent | 40ac381fad2cc31f75014f02d3e8bf755d933abb (diff) | |
download | pip-1.1.tar.gz |
Merge branch 'release/1.1'1.1
Diffstat (limited to 'tests/test_index.py')
-rw-r--r-- | tests/test_index.py | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/test_index.py b/tests/test_index.py index e5385c452..6f9d216dc 100644 --- a/tests/test_index.py +++ b/tests/test_index.py @@ -1,4 +1,5 @@ -from pip.index import package_to_requirement +from pip.index import package_to_requirement, HTMLPage + def test_package_name_should_be_converted_to_requirement(): """ @@ -6,4 +7,22 @@ def test_package_name_should_be_converted_to_requirement(): """ assert package_to_requirement('Foo-1.2') == 'Foo==1.2' assert package_to_requirement('Foo-dev') == 'Foo==dev' - assert package_to_requirement('Foo') == 'Foo'
\ No newline at end of file + assert package_to_requirement('Foo') == 'Foo' + + +def test_html_page_should_be_able_to_scrap_rel_links(): + """ + Test scraping page looking for url in href + """ + page = HTMLPage(""" + <!-- The <th> elements below are a terrible terrible hack for setuptools --> + <li> + <strong>Home Page:</strong> + <!-- <th>Home Page --> + <a href="http://supervisord.org/">http://supervisord.org/</a> + </li>""", "supervisor") + + links = list(page.scraped_rel_links()) + assert len(links) == 1 + assert links[0].url == 'http://supervisord.org/' + |