summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-12-01 06:05:38 -0500
committerJason R. Coombs <jaraco@jaraco.com>2013-12-01 06:05:38 -0500
commit18fc70484bcb540ae9d307733155ea6d0663b30b (patch)
treed2bf95f2514be5f0f06a03c1efc94e24c908169a
parent08fc7a8c2d632d0131d3bd2d300f59b92afb38cd (diff)
downloadpython-setuptools-bitbucket-18fc70484bcb540ae9d307733155ea6d0663b30b.tar.gz
Adding test capturing #116
-rw-r--r--setuptools/tests/test_packageindex.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index 08969b7e..5a0c3946 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -151,6 +151,20 @@ class TestPackageIndex(unittest.TestCase):
self.assertEqual(url, 'https://example.com/bar')
self.assertEqual(rev, '2995')
+ def test_local_index(self):
+ f = open('index.html', 'w')
+ f.write('<div>content</div>')
+ f.close()
+ try:
+ import urllib.request
+ import os
+ url = 'file:' + urllib.request.pathname2url(os.getcwd()) + '/'
+ res = setuptools.package_index.local_open(url)
+ finally:
+ os.remove('index.html')
+ assert 'content' in res.read()
+
+
class TestContentCheckers(unittest.TestCase):
def test_md5(self):