summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_packageindex.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-07-20 11:43:04 -0400
committerJason R. Coombs <jaraco@jaraco.com>2016-07-20 11:43:04 -0400
commit39374cb5747b8cc18240f474d10d17913f203b67 (patch)
treee81f22fee5672ee991fe4c0b1baaaf31f13ba3f9 /setuptools/tests/test_packageindex.py
parent1a7027931dc594a60bc91ed98b96c5230df471bb (diff)
downloadpython-setuptools-git-39374cb5747b8cc18240f474d10d17913f203b67.tar.gz
Add test capturing expectation of PYPI_MD5 pattern
Diffstat (limited to 'setuptools/tests/test_packageindex.py')
-rw-r--r--setuptools/tests/test_packageindex.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index dda55382..b2b0d537 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -15,6 +15,16 @@ from setuptools.tests.server import IndexServer
class TestPackageIndex:
+ def test_regex(self):
+ hash_url = 'http://other_url?:action=show_md5&amp;'
+ hash_url += 'digest=0123456789abcdef0123456789abcdef'
+ doc = """
+ <a href="http://some_url">Name</a>
+ (<a title="MD5 hash"
+ href="{hash_url}">md5</a>)
+ """.lstrip().format(**locals())
+ assert setuptools.package_index.PYPI_MD5.match(doc)
+
def test_bad_url_bad_port(self):
index = setuptools.package_index.PackageIndex()
url = 'http://127.0.0.1:0/nonesuch/test_package_index'