summaryrefslogtreecommitdiff
path: root/setuptools/tests
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-12-01 06:17:58 -0500
committerJason R. Coombs <jaraco@jaraco.com>2013-12-01 06:17:58 -0500
commit727a101b0a76bd93c35b41352b2a52ca261a8cf7 (patch)
tree1b9d9ed384baf9b18c9b602f286a1dad3cd836ae /setuptools/tests
parent4e2c005f8702ed7e2bce31425748eb83f3e9db0f (diff)
parentaf3e8f78ae796b4e517547608a6cafaa835c430f (diff)
downloadpython-setuptools-git-727a101b0a76bd93c35b41352b2a52ca261a8cf7.tar.gz
Merge with 1.4.2
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_packageindex.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py
index 08969b7e..664566a3 100644
--- a/setuptools/tests/test_packageindex.py
+++ b/setuptools/tests/test_packageindex.py
@@ -1,9 +1,10 @@
"""Package Index Tests
"""
import sys
+import os
import unittest
import pkg_resources
-from setuptools.compat import urllib2, httplib, HTTPError, unicode
+from setuptools.compat import urllib2, httplib, HTTPError, unicode, pathname2url
import distutils.errors
import setuptools.package_index
from setuptools.tests.server import IndexServer
@@ -151,6 +152,21 @@ class TestPackageIndex(unittest.TestCase):
self.assertEqual(url, 'https://example.com/bar')
self.assertEqual(rev, '2995')
+ def test_local_index(self):
+ """
+ local_open should be able to read an index from the file system.
+ """
+ f = open('index.html', 'w')
+ f.write('<div>content</div>')
+ f.close()
+ try:
+ url = 'file:' + 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):