def test_install_package_with_root(script, data):
 root_dir = (script.scratch_path / 'root')
 result = script.pip('install', '--root', root_dir, '-f', data.find_links, '--no-index', 'simple==1.0')
 normal_install_path = (((script.base_path / script.site_packages) / 'simple-1.0-py%s.egg-info') % pyversion)
 from distutils.util import change_root
 root_path = change_root(os.path.join(script.scratch, 'root'), normal_install_path)
 assert (root_path in result.files_created), str(result)

def test_install_package_with_root ( script , data ) : root_dir = ( script . scratch_path / 'root' ) result = script . pip ( 'install' , '--root' , root_dir , '-f' , data . find_links , '--no-index' , 'simple==1.0' ) normal_install_path = ( ( ( script . base_path / script . site_packages ) / 'simple-1.0-py%s.egg-info' ) % pyversion ) from distutils . util import change_root root_path = change_root ( os . path . join ( script . scratch , 'root' ) , normal_install_path ) assert ( root_path in result . files_created ) , str ( result )
test installing a package using pip install --root .