'When easy_install installs a source distribution which specifies
setup_requires, it should honor the fetch parameters (such as
allow-hosts, index-url, and find-links).'

def test_setup_requires_honors_fetch_params(self):

    p_index = setuptools.tests.server.MockServer()
    p_index.start()
    netloc = 1
    p_index_loc = urlparse(p_index.url)[netloc]
    if p_index_loc.endswith(':0'):
        return
    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', p_index_loc, '--exclude-scripts', '--install-dir', temp_install_dir, dist_file]
                with reset_setup_stop_context():
                    with argv_context(['easy_install']):
                        self.assertRaises(SystemExit, easy_install_pkg.main, ei_params)
    self.assertTrue((2 <= len(p_index.requests) <= 3))
    self.assertEqual(p_index.requests[0].path, '/does-not-exist/')
