summaryrefslogtreecommitdiff
path: root/setuptools/tests/test_packageindex.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-09-27 14:24:22 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-09-27 14:24:22 -0500
commit66a6724da8eda3336643dee086da2a3495e6422a (patch)
tree64043e9782491bde3a3a9ae2314cc59451a6c9c0 /setuptools/tests/test_packageindex.py
parentdf3905616933c90af95e99f705b800a2f5c1c921 (diff)
parent35ea365b50bd1a64375fdbcce187affab22af3b7 (diff)
downloadpython-setuptools-git-setuptools-scm.tar.gz
Merge with mastersetuptools-scm
Diffstat (limited to 'setuptools/tests/test_packageindex.py')
-rw-r--r--setuptools/tests/test_packageindex.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index 6a76b5fc..f9bf895b 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -7,14 +7,24 @@ import distutils.errors
from setuptools.extern import six
from setuptools.extern.six.moves import urllib, http_client
-from .textwrap import DALS
import pkg_resources
import setuptools.package_index
from setuptools.tests.server import IndexServer
+from .textwrap import DALS
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'
@@ -129,7 +139,7 @@ class TestPackageIndex:
# the distribution has been found
assert 'foobar' in pi
# we have only one link, because links are compared without md5
- assert len(pi['foobar'])==1
+ assert len(pi['foobar']) == 1
# the link should be from the index
assert 'correct_md5' in pi['foobar'][0].location
@@ -209,6 +219,7 @@ class TestContentCheckers:
class TestPyPIConfig:
+
def test_percent_in_password(self, tmpdir, monkeypatch):
monkeypatch.setitem(os.environ, 'HOME', str(tmpdir))
pypirc = tmpdir / '.pypirc'