From a87729f8b64b95cc203ae8e71fc6b5150725e1e7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 1 Dec 2013 06:05:38 -0500 Subject: Adding test capturing #116 --- setuptools/tests/test_packageindex.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'setuptools/tests/test_packageindex.py') 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('
content
') + 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): -- cgit v1.2.3