aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_easy_install.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2012-04-07 12:16:56 -0400
committerJason R. Coombs <jaraco@jaraco.com>2012-04-07 12:16:56 -0400
commitdea4120fdc2cd90d9d68d3ffbc6e2118aadde125 (patch)
treec0bec5459dac52e9a5078242e19533b603315bc7 /setuptools/tests/test_easy_install.py
parent5112a1e998a49093f2531fa17fbbb21b6fcdb9d2 (diff)
downloadexternal_python_setuptools-dea4120fdc2cd90d9d68d3ffbc6e2118aadde125.tar.gz
external_python_setuptools-dea4120fdc2cd90d9d68d3ffbc6e2118aadde125.tar.bz2
external_python_setuptools-dea4120fdc2cd90d9d68d3ffbc6e2118aadde125.zip
Improved the MockServer so it now more effectively handles multiple requests (as any index server really must).
Test now more accurately captures the working scenario. --HG-- branch : distribute extra : rebase_source : 8ee0afdd95219047e4700b85356792f6128b1fd8
Diffstat (limited to 'setuptools/tests/test_easy_install.py')
-rw-r--r--setuptools/tests/test_easy_install.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index 54e3cdf9..87d24bb7 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -9,6 +9,7 @@ import site
import contextlib
import textwrap
import tarfile
+import urlparse
from setuptools.command.easy_install import easy_install, get_script_args, main
from setuptools.command.easy_install import PthDistributions
@@ -269,13 +270,14 @@ class TestSetupRequires(unittest.TestCase):
"""
# set up a server which will simulate an alternate package index.
p_index = setuptools.tests.server.MockServer()
- p_index.handle_request_in_thread()
+ p_index.start()
+ p_index_loc = urlparse.urlparse(p_index.url).netloc
# create an sdist that has a build-time dependency.
with TestSetupRequires.create_sdist() as dist_file:
with tempdir_context() as temp_install_dir:
with environment_context(PYTHONPATH=temp_install_dir):
ei_params = ['--index-url', p_index.url,
- '--allow-hosts', 'localhost',
+ '--allow-hosts', p_index_loc,
'--exclude-scripts', '--install-dir', temp_install_dir,
dist_file]
# attempt to install the dist. It should fail because
@@ -283,8 +285,8 @@ class TestSetupRequires(unittest.TestCase):
self.assertRaises(SystemExit,
easy_install_pkg.main, ei_params)
#self.assertTrue(os.listdir(temp_install_dir))
- self.assertEqual(len(p_index.requests), 1)
- self.assertEqual(p_index.requests[0].path, 'x')
+ self.assertEqual(len(p_index.requests), 2)
+ self.assertEqual(p_index.requests[0].path, '/does-not-exist/')
@staticmethod
@contextlib.contextmanager