<s> from __future__ import print_function <EOL> import os , sys , shutil , unittest , tempfile , tarfile , virtualenv , warnings <EOL> sys . path . insert ( <NUM_LIT:0> , "<STR_LIT:src>" ) <EOL> from from_file import versions_from_file <EOL> import common <EOL> pyver_major = "<STR_LIT>" % sys . version_info [ <NUM_LIT:0> ] <EOL> pyver = "<STR_LIT>" % sys . version_info [ : <NUM_LIT:2> ] <EOL> if not hasattr ( unittest , "<STR_LIT>" ) : <EOL> def _skip ( reason ) : <EOL> def _skip_decorator ( f ) : <EOL> def _skipped_test ( * args , ** kwargs ) : <EOL> print ( "<STR_LIT>" % reason ) <EOL> return _skipped_test <EOL> return _skip_decorator <EOL> unittest . skip = _skip <EOL> if not hasattr ( unittest , "<STR_LIT>" ) : <EOL> def _expectedFailure ( reason = "<STR_LIT>" ) : <EOL> def _ef_decorator ( f ) : <EOL> def _ef ( * args , ** kwargs ) : <EOL> print ( "<STR_LIT>" % reason ) <EOL> return _ef <EOL> return _ef_decorator <EOL> unittest . expectedFailure = _expectedFailure <EOL> class _Invocations ( common . Common ) : <EOL> def setUp ( self ) : <EOL> if False : <EOL> self . testdir = os . path . abspath ( "<STR_LIT:t>" ) <EOL> if os . path . exists ( self . testdir ) : <EOL> return <EOL> os . mkdir ( self . testdir ) <EOL> else : <EOL> self . testdir = tempfile . mkdtemp ( ) <EOL> os . mkdir ( self . subpath ( "<STR_LIT>" ) ) <EOL> os . mkdir ( self . subpath ( "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> os . mkdir ( self . subpath ( "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> self . gitdir = None <EOL> self . projdir = None <EOL> def make_venv ( self , mode ) : <EOL> if not os . path . exists ( self . subpath ( "<STR_LIT>" ) ) : <EOL> os . mkdir ( self . subpath ( "<STR_LIT>" ) ) <EOL> venv_dir = self . subpath ( "<STR_LIT>" % mode ) <EOL> os . environ . pop ( "<STR_LIT>" , None ) <EOL> virtualenv . logger = virtualenv . Logger ( [ ] ) <EOL> with warnings . catch_warnings ( ) : <EOL> warnings . simplefilter ( "<STR_LIT:ignore>" ) <EOL> virtualenv . create_environment ( venv_dir ) <EOL> return venv_dir <EOL> def run_in_venv ( self , venv , workdir , command , * args ) : <EOL> bins = { "<STR_LIT>" : os . path . join ( venv , "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : os . path . join ( venv , "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : os . path . join ( venv , "<STR_LIT>" , "<STR_LIT>" ) , <EOL> "<STR_LIT>" : os . path . join ( venv , "<STR_LIT>" , "<STR_LIT>" ) , <EOL> } <EOL> if command == "<STR_LIT>" : <EOL> args = [ "<STR_LIT>" ] + list ( args ) <EOL> maj , min = sys . version_info [ <NUM_LIT:0> : <NUM_LIT:2> ] <EOL> if ( ( maj == <NUM_LIT:2> and min >= <NUM_LIT:7> ) or <EOL> ( maj == <NUM_LIT:3> and min >= <NUM_LIT:4> ) or <EOL> maj > <NUM_LIT:3> ) : <EOL> args = [ "<STR_LIT>" ] + list ( args ) <EOL> return self . command ( bins [ command ] , * args , workdir = workdir ) <EOL> def check_in_venv ( self , venv ) : <EOL> out = self . run_in_venv ( venv , venv , "<STR_LIT>" ) <EOL> v = dict ( [ line . split ( "<STR_LIT::>" , <NUM_LIT:1> ) for line in out . splitlines ( ) ] ) <EOL> self . assertEqual ( v [ "<STR_LIT:version>" ] , "<STR_LIT>" ) <EOL> return v <EOL> def check_in_venv_withlib ( self , venv ) : <EOL> v = self . check_in_venv ( venv ) <EOL> self . assertEqual ( v [ "<STR_LIT>" ] , "<STR_LIT:1.0>" ) <EOL> def make_demolib_sdist ( self ) : <EOL> demolib_sdist = self . subpath ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> if os . path . exists ( demolib_sdist ) : <EOL> return demolib_sdist <EOL> libdir = self . subpath ( "<STR_LIT>" ) <EOL> shutil . copytree ( "<STR_LIT>" , libdir ) <EOL> shutil . copy ( "<STR_LIT>" , libdir ) <EOL> self . git ( "<STR_LIT>" , workdir = libdir ) <EOL> self . python ( "<STR_LIT>" , "<STR_LIT>" , workdir = libdir ) <EOL> self . git ( "<STR_LIT>" , "<STR_LIT>" , workdir = libdir ) <EOL> self . git ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , workdir = libdir ) <EOL> self . git ( "<STR_LIT>" , "<STR_LIT>" , workdir = libdir ) <EOL> self . python ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , workdir = libdir ) <EOL> created = os . path . join ( libdir , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . assertTrue ( os . path . exists ( created ) ) <EOL> shutil . copyfile ( created , demolib_sdist ) <EOL> return demolib_sdist <EOL> def make_linkdir ( self ) : <EOL> linkdir = self . subpath ( "<STR_LIT>" ) <EOL> if os . path . exists ( linkdir ) : <EOL> return linkdir <EOL> os . mkdir ( linkdir ) <EOL> demolib_sdist = self . make_demolib_sdist ( ) <EOL> shutil . copy ( demolib_sdist , linkdir ) <EOL> return linkdir <EOL> def make_empty_indexdir ( self ) : <EOL> indexdir = self . subpath ( "<STR_LIT>" ) <EOL> if os . path . exists ( indexdir ) : <EOL> return indexdir <EOL> os . mkdir ( indexdir ) <EOL> return indexdir <EOL> def make_distutils_repo ( self ) : <EOL> repodir = self . subpath ( "<STR_LIT>" ) <EOL> if os . path . exists ( repodir ) : <EOL> shutil . rmtree ( repodir ) <EOL> shutil . copytree ( "<STR_LIT>" , repodir ) <EOL> shutil . copy ( "<STR_LIT>" , repodir ) <EOL> self . git ( "<STR_LIT>" , workdir = repodir ) <EOL> self . python ( "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> self . git ( "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> self . git ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> self . git ( "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> return repodir <EOL> def make_distutils_repo_subproject ( self ) : <EOL> repodir = self . subpath ( "<STR_LIT>" ) <EOL> if os . path . exists ( repodir ) : <EOL> shutil . rmtree ( repodir ) <EOL> shutil . copytree ( "<STR_LIT>" , repodir ) <EOL> projectdir = os . path . join ( repodir , "<STR_LIT>" ) <EOL> shutil . copy ( "<STR_LIT>" , projectdir ) <EOL> self . git ( "<STR_LIT>" , workdir = repodir ) <EOL> self . python ( "<STR_LIT>" , "<STR_LIT>" , workdir = projectdir ) <EOL> self . git ( "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> self . git ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> self . git ( "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> return projectdir <EOL> def make_distutils_wheel_with_pip ( self ) : <EOL> wheelname = "<STR_LIT>" % pyver_major <EOL> demoapp2_distutils_wheel = self . subpath ( "<STR_LIT>" , "<STR_LIT>" , wheelname ) <EOL> if os . path . exists ( demoapp2_distutils_wheel ) : <EOL> return demoapp2_distutils_wheel <EOL> repodir = self . make_distutils_repo ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , repodir , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT:.>" ) <EOL> created = os . path . join ( repodir , "<STR_LIT>" , wheelname ) <EOL> self . assertTrue ( os . path . exists ( created ) , created ) <EOL> shutil . copyfile ( created , demoapp2_distutils_wheel ) <EOL> return demoapp2_distutils_wheel <EOL> def make_distutils_sdist ( self ) : <EOL> demoapp2_distutils_sdist = self . subpath ( "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" ) <EOL> if os . path . exists ( demoapp2_distutils_sdist ) : <EOL> return demoapp2_distutils_sdist <EOL> repodir = self . make_distutils_repo ( ) <EOL> self . python ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> created = os . path . join ( repodir , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . assertTrue ( os . path . exists ( created ) , created ) <EOL> shutil . copyfile ( created , demoapp2_distutils_sdist ) <EOL> return demoapp2_distutils_sdist <EOL> def make_distutils_sdist_subproject ( self ) : <EOL> demoapp2_distutils_sdist = self . subpath ( "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" ) <EOL> if os . path . exists ( demoapp2_distutils_sdist ) : <EOL> return demoapp2_distutils_sdist <EOL> projectdir = self . make_distutils_repo_subproject ( ) <EOL> self . python ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , workdir = projectdir ) <EOL> created = os . path . join ( projectdir , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . assertTrue ( os . path . exists ( created ) , created ) <EOL> shutil . copyfile ( created , demoapp2_distutils_sdist ) <EOL> return demoapp2_distutils_sdist <EOL> def make_distutils_unpacked ( self ) : <EOL> sdist = self . make_distutils_sdist ( ) <EOL> unpack_into = self . subpath ( "<STR_LIT>" ) <EOL> if os . path . exists ( unpack_into ) : <EOL> shutil . rmtree ( unpack_into ) <EOL> os . mkdir ( unpack_into ) <EOL> t = tarfile . TarFile ( sdist ) <EOL> t . extractall ( path = unpack_into ) <EOL> t . close ( ) <EOL> unpacked = os . path . join ( unpack_into , "<STR_LIT>" ) <EOL> self . assertTrue ( os . path . exists ( unpacked ) ) <EOL> return unpacked <EOL> def make_distutils_subproject_unpacked ( self ) : <EOL> sdist = self . make_distutils_sdist_subproject ( ) <EOL> unpack_into = self . subpath ( "<STR_LIT>" ) <EOL> if os . path . exists ( unpack_into ) : <EOL> shutil . rmtree ( unpack_into ) <EOL> os . mkdir ( unpack_into ) <EOL> t = tarfile . TarFile ( sdist ) <EOL> t . extractall ( path = unpack_into ) <EOL> t . close ( ) <EOL> unpacked = os . path . join ( unpack_into , "<STR_LIT>" ) <EOL> self . assertTrue ( os . path . exists ( unpacked ) ) <EOL> return unpacked <EOL> def make_setuptools_repo ( self ) : <EOL> repodir = self . subpath ( "<STR_LIT>" ) <EOL> if os . path . exists ( repodir ) : <EOL> shutil . rmtree ( repodir ) <EOL> shutil . copytree ( "<STR_LIT>" , repodir ) <EOL> shutil . copy ( "<STR_LIT>" , repodir ) <EOL> self . git ( "<STR_LIT>" , workdir = repodir ) <EOL> self . python ( "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> self . git ( "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> self . git ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> self . git ( "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> return repodir <EOL> def make_setuptools_repo_subproject ( self ) : <EOL> repodir = self . subpath ( "<STR_LIT>" ) <EOL> if os . path . exists ( repodir ) : <EOL> shutil . rmtree ( repodir ) <EOL> shutil . copytree ( "<STR_LIT>" , repodir ) <EOL> projectdir = os . path . join ( repodir , "<STR_LIT>" ) <EOL> shutil . copy ( "<STR_LIT>" , projectdir ) <EOL> self . git ( "<STR_LIT>" , workdir = repodir ) <EOL> self . python ( "<STR_LIT>" , "<STR_LIT>" , workdir = projectdir ) <EOL> self . git ( "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> self . git ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> self . git ( "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> return projectdir <EOL> def make_setuptools_sdist ( self ) : <EOL> demoapp2_setuptools_sdist = self . subpath ( "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" ) <EOL> if os . path . exists ( demoapp2_setuptools_sdist ) : <EOL> return demoapp2_setuptools_sdist <EOL> repodir = self . make_setuptools_repo ( ) <EOL> self . python ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> created = os . path . join ( repodir , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . assertTrue ( os . path . exists ( created ) , created ) <EOL> shutil . copyfile ( created , demoapp2_setuptools_sdist ) <EOL> return demoapp2_setuptools_sdist <EOL> def make_setuptools_sdist_subproject ( self ) : <EOL> demoapp2_setuptools_sdist = self . subpath ( "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" ) <EOL> if os . path . exists ( demoapp2_setuptools_sdist ) : <EOL> return demoapp2_setuptools_sdist <EOL> projectdir = self . make_setuptools_repo_subproject ( ) <EOL> self . python ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , workdir = projectdir ) <EOL> created = os . path . join ( projectdir , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . assertTrue ( os . path . exists ( created ) , created ) <EOL> shutil . copyfile ( created , demoapp2_setuptools_sdist ) <EOL> return demoapp2_setuptools_sdist <EOL> def make_setuptools_unpacked ( self ) : <EOL> sdist = self . make_setuptools_sdist ( ) <EOL> unpack_into = self . subpath ( "<STR_LIT>" ) <EOL> if os . path . exists ( unpack_into ) : <EOL> shutil . rmtree ( unpack_into ) <EOL> os . mkdir ( unpack_into ) <EOL> t = tarfile . TarFile ( sdist ) <EOL> t . extractall ( path = unpack_into ) <EOL> t . close ( ) <EOL> unpacked = os . path . join ( unpack_into , "<STR_LIT>" ) <EOL> self . assertTrue ( os . path . exists ( unpacked ) ) <EOL> return unpacked <EOL> def make_setuptools_subproject_unpacked ( self ) : <EOL> sdist = self . make_setuptools_sdist_subproject ( ) <EOL> unpack_into = self . subpath ( "<STR_LIT>" ) <EOL> if os . path . exists ( unpack_into ) : <EOL> shutil . rmtree ( unpack_into ) <EOL> os . mkdir ( unpack_into ) <EOL> t = tarfile . TarFile ( sdist ) <EOL> t . extractall ( path = unpack_into ) <EOL> t . close ( ) <EOL> unpacked = os . path . join ( unpack_into , "<STR_LIT>" ) <EOL> self . assertTrue ( os . path . exists ( unpacked ) ) <EOL> return unpacked <EOL> def make_setuptools_egg ( self ) : <EOL> demoapp2_setuptools_egg = self . subpath ( "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" % pyver ) <EOL> if os . path . exists ( demoapp2_setuptools_egg ) : <EOL> return demoapp2_setuptools_egg <EOL> repodir = self . make_setuptools_repo ( ) <EOL> self . python ( "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> created = os . path . join ( repodir , "<STR_LIT>" , "<STR_LIT>" % pyver ) <EOL> self . assertTrue ( os . path . exists ( created ) , created ) <EOL> shutil . copyfile ( created , demoapp2_setuptools_egg ) <EOL> return demoapp2_setuptools_egg <EOL> def make_setuptools_wheel_with_setup_py ( self ) : <EOL> wheelname = "<STR_LIT>" % pyver_major <EOL> demoapp2_setuptools_wheel = self . subpath ( "<STR_LIT>" , "<STR_LIT>" , <EOL> wheelname ) <EOL> if os . path . exists ( demoapp2_setuptools_wheel ) : <EOL> os . unlink ( demoapp2_setuptools_wheel ) <EOL> repodir = self . make_setuptools_repo ( ) <EOL> self . python ( "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> created = os . path . join ( repodir , "<STR_LIT>" , wheelname ) <EOL> self . assertTrue ( os . path . exists ( created ) , created ) <EOL> shutil . copyfile ( created , demoapp2_setuptools_wheel ) <EOL> return demoapp2_setuptools_wheel <EOL> def make_setuptools_wheel_with_pip ( self ) : <EOL> wheelname = "<STR_LIT>" % pyver_major <EOL> demoapp2_setuptools_wheel = self . subpath ( "<STR_LIT>" , "<STR_LIT>" , <EOL> wheelname ) <EOL> if os . path . exists ( demoapp2_setuptools_wheel ) : <EOL> os . unlink ( demoapp2_setuptools_wheel ) <EOL> linkdir = self . make_linkdir ( ) <EOL> repodir = self . make_setuptools_repo ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , repodir , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , linkdir , <EOL> "<STR_LIT:.>" ) <EOL> created = os . path . join ( repodir , "<STR_LIT>" , wheelname ) <EOL> self . assertTrue ( os . path . exists ( created ) , created ) <EOL> shutil . copyfile ( created , demoapp2_setuptools_wheel ) <EOL> return demoapp2_setuptools_wheel <EOL> class DistutilsRepo ( _Invocations , unittest . TestCase ) : <EOL> def test_build ( self ) : <EOL> repodir = self . make_distutils_repo ( ) <EOL> self . python ( "<STR_LIT>" , "<STR_LIT>" , workdir = repodir ) <EOL> fn = os . path . join ( repodir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> data = versions_from_file ( fn ) <EOL> self . assertEqual ( data [ "<STR_LIT:version>" ] , "<STR_LIT>" ) <EOL> def test_install ( self ) : <EOL> repodir = self . make_distutils_repo ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , repodir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . check_in_venv ( venv ) <EOL> def test_install_subproject ( self ) : <EOL> projectdir = self . make_distutils_repo_subproject ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , projectdir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . check_in_venv ( venv ) <EOL> def test_pip_wheel ( self ) : <EOL> self . make_distutils_wheel_with_pip ( ) <EOL> def test_sdist ( self ) : <EOL> sdist = self . make_distutils_sdist ( ) <EOL> t = tarfile . TarFile ( sdist ) <EOL> self . assertFalse ( "<STR_LIT>" in <EOL> t . getnames ( ) ) <EOL> t . close ( ) <EOL> def test_sdist_subproject ( self ) : <EOL> sdist = self . make_distutils_sdist_subproject ( ) <EOL> t = tarfile . TarFile ( sdist ) <EOL> self . assertFalse ( "<STR_LIT>" in <EOL> t . getnames ( ) ) <EOL> t . close ( ) <EOL> def test_pip_install ( self ) : <EOL> repodir = self . make_distutils_repo ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , repodir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:.>" ) <EOL> self . check_in_venv ( venv ) <EOL> @ unittest . expectedFailure <EOL> def test_pip_install_subproject ( self ) : <EOL> projectdir = self . make_distutils_repo_subproject ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , projectdir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:.>" ) <EOL> self . check_in_venv ( venv ) <EOL> def test_pip_install_from_afar ( self ) : <EOL> repodir = self . make_distutils_repo ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , "<STR_LIT>" , "<STR_LIT>" , repodir ) <EOL> self . check_in_venv ( venv ) <EOL> @ unittest . expectedFailure <EOL> def test_pip_install_from_afar_subproject ( self ) : <EOL> projectdir = self . make_distutils_repo_subproject ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , "<STR_LIT>" , "<STR_LIT>" , projectdir ) <EOL> self . check_in_venv ( venv ) <EOL> def test_pip_install_editable ( self ) : <EOL> repodir = self . make_distutils_repo ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , repodir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:.>" ) <EOL> self . check_in_venv ( venv ) <EOL> def test_pip_install_editable_subproject ( self ) : <EOL> projectdir = self . make_distutils_repo_subproject ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , projectdir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:.>" ) <EOL> self . check_in_venv ( venv ) <EOL> class SetuptoolsRepo ( _Invocations , unittest . TestCase ) : <EOL> def test_install ( self ) : <EOL> repodir = self . make_setuptools_repo ( ) <EOL> demolib = self . make_demolib_sdist ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , "<STR_LIT>" , "<STR_LIT>" , demolib ) <EOL> self . run_in_venv ( venv , repodir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> def test_install_subproject ( self ) : <EOL> projectdir = self . make_setuptools_repo_subproject ( ) <EOL> demolib = self . make_demolib_sdist ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , "<STR_LIT>" , "<STR_LIT>" , demolib ) <EOL> self . run_in_venv ( venv , projectdir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> @ unittest . skip ( "<STR_LIT>" ) <EOL> def test_easy_install ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> indexdir = self . make_empty_indexdir ( ) <EOL> repodir = self . make_setuptools_repo ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , repodir , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , indexdir , "<STR_LIT>" , linkdir , <EOL> "<STR_LIT:.>" <EOL> ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> def test_develop ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> indexdir = self . make_empty_indexdir ( ) <EOL> repodir = self . make_setuptools_repo ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , repodir , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , indexdir , "<STR_LIT>" , linkdir , <EOL> ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> def test_develop_subproject ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> indexdir = self . make_empty_indexdir ( ) <EOL> projectdir = self . make_setuptools_repo_subproject ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , projectdir , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , indexdir , "<STR_LIT>" , linkdir , <EOL> ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> def test_egg ( self ) : <EOL> self . make_setuptools_egg ( ) <EOL> def test_pip_wheel ( self ) : <EOL> self . make_setuptools_wheel_with_pip ( ) <EOL> def test_bdist_wheel ( self ) : <EOL> self . make_setuptools_wheel_with_setup_py ( ) <EOL> def test_sdist ( self ) : <EOL> sdist = self . make_setuptools_sdist ( ) <EOL> t = tarfile . TarFile ( sdist ) <EOL> self . assertTrue ( "<STR_LIT>" in <EOL> t . getnames ( ) ) <EOL> t . close ( ) <EOL> def test_sdist_subproject ( self ) : <EOL> sdist = self . make_setuptools_sdist_subproject ( ) <EOL> t = tarfile . TarFile ( sdist ) <EOL> self . assertTrue ( "<STR_LIT>" in <EOL> t . getnames ( ) ) <EOL> t . close ( ) <EOL> def test_pip_install ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> repodir = self . make_setuptools_repo ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , repodir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:.>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , linkdir ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> @ unittest . expectedFailure <EOL> def test_pip_install_subproject ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> projectdir = self . make_setuptools_repo_subproject ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , projectdir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:.>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , linkdir ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> def test_pip_install_from_afar ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> repodir = self . make_setuptools_repo ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , "<STR_LIT>" , "<STR_LIT>" , repodir , <EOL> "<STR_LIT>" , "<STR_LIT>" , linkdir ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> @ unittest . expectedFailure <EOL> def test_pip_install_from_afar_subproject ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> projectdir = self . make_setuptools_repo_subproject ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , "<STR_LIT>" , "<STR_LIT>" , projectdir , <EOL> "<STR_LIT>" , "<STR_LIT>" , linkdir ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> def test_pip_install_editable ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> repodir = self . make_setuptools_repo ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , repodir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:.>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , linkdir ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> def test_pip_install_editable_subproject ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> projectdir = self . make_setuptools_repo_subproject ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , projectdir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:.>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , linkdir ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> class DistutilsSdist ( _Invocations , unittest . TestCase ) : <EOL> def test_pip_install ( self ) : <EOL> sdist = self . make_distutils_sdist ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , <EOL> "<STR_LIT>" , "<STR_LIT>" , sdist ) <EOL> self . check_in_venv ( venv ) <EOL> def test_pip_install_subproject ( self ) : <EOL> sdist = self . make_distutils_sdist_subproject ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , <EOL> "<STR_LIT>" , "<STR_LIT>" , sdist ) <EOL> self . check_in_venv ( venv ) <EOL> def test_easy_install ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> indexdir = self . make_empty_indexdir ( ) <EOL> sdist = self . make_distutils_sdist ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , indexdir , "<STR_LIT>" , linkdir , <EOL> sdist ) <EOL> self . check_in_venv ( venv ) <EOL> class SetuptoolsSdist ( _Invocations , unittest . TestCase ) : <EOL> def test_pip_install ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> sdist = self . make_setuptools_sdist ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , linkdir , <EOL> sdist ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> def test_pip_install_subproject ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> sdist = self . make_setuptools_sdist_subproject ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , linkdir , <EOL> sdist ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> def test_easy_install ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> indexdir = self . make_empty_indexdir ( ) <EOL> sdist = self . make_setuptools_sdist ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , indexdir , "<STR_LIT>" , linkdir , <EOL> sdist ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> class SetuptoolsWheel ( _Invocations , unittest . TestCase ) : <EOL> def test_pip_install ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> wheel = self . make_setuptools_wheel_with_setup_py ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , linkdir , <EOL> wheel ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> class Egg ( _Invocations , unittest . TestCase ) : <EOL> def test_easy_install ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> indexdir = self . make_empty_indexdir ( ) <EOL> egg = self . make_setuptools_egg ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" , indexdir , "<STR_LIT>" , linkdir , <EOL> egg ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> class DistutilsUnpacked ( _Invocations , unittest . TestCase ) : <EOL> def test_build ( self ) : <EOL> unpacked = self . make_distutils_unpacked ( ) <EOL> self . python ( "<STR_LIT>" , "<STR_LIT>" , workdir = unpacked ) <EOL> fn = os . path . join ( unpacked , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> data = versions_from_file ( fn ) <EOL> self . assertEqual ( data [ "<STR_LIT:version>" ] , "<STR_LIT>" ) <EOL> def test_install ( self ) : <EOL> unpacked = self . make_distutils_unpacked ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , unpacked , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . check_in_venv ( venv ) <EOL> def test_install_subproject ( self ) : <EOL> unpacked = self . make_distutils_subproject_unpacked ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , unpacked , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . check_in_venv ( venv ) <EOL> def test_pip_wheel ( self ) : <EOL> unpacked = self . make_distutils_unpacked ( ) <EOL> wheelname = "<STR_LIT>" % pyver_major <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , unpacked , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT:.>" ) <EOL> created = os . path . join ( unpacked , "<STR_LIT>" , wheelname ) <EOL> self . assertTrue ( os . path . exists ( created ) , created ) <EOL> def test_pip_install ( self ) : <EOL> repodir = self . make_distutils_unpacked ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , repodir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:.>" ) <EOL> self . check_in_venv ( venv ) <EOL> def test_pip_install_subproject ( self ) : <EOL> unpacked = self . make_distutils_subproject_unpacked ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , unpacked , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:.>" ) <EOL> self . check_in_venv ( venv ) <EOL> def test_pip_install_from_afar ( self ) : <EOL> repodir = self . make_distutils_unpacked ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , "<STR_LIT>" , "<STR_LIT>" , repodir ) <EOL> self . check_in_venv ( venv ) <EOL> class SetuptoolsUnpacked ( _Invocations , unittest . TestCase ) : <EOL> def test_install ( self ) : <EOL> unpacked = self . make_setuptools_unpacked ( ) <EOL> demolib = self . make_demolib_sdist ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , "<STR_LIT>" , "<STR_LIT>" , demolib ) <EOL> self . run_in_venv ( venv , unpacked , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> def test_install_subproject ( self ) : <EOL> unpacked = self . make_setuptools_subproject_unpacked ( ) <EOL> demolib = self . make_demolib_sdist ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , "<STR_LIT>" , "<STR_LIT>" , demolib ) <EOL> self . run_in_venv ( venv , unpacked , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> def test_easy_install ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> indexdir = self . make_empty_indexdir ( ) <EOL> unpacked = self . make_setuptools_unpacked ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , unpacked , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , indexdir , "<STR_LIT>" , linkdir , <EOL> "<STR_LIT:.>" <EOL> ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> def test_wheel ( self ) : <EOL> unpacked = self . make_setuptools_unpacked ( ) <EOL> self . python ( "<STR_LIT>" , "<STR_LIT>" , workdir = unpacked ) <EOL> wheelname = "<STR_LIT>" % pyver_major <EOL> wheel = os . path . join ( unpacked , "<STR_LIT>" , wheelname ) <EOL> self . assertTrue ( os . path . exists ( wheel ) ) <EOL> def test_pip_wheel ( self ) : <EOL> unpacked = self . make_setuptools_unpacked ( ) <EOL> linkdir = self . make_linkdir ( ) <EOL> wheelname = "<STR_LIT>" % pyver_major <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , unpacked , <EOL> "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , linkdir , <EOL> "<STR_LIT:.>" ) <EOL> created = os . path . join ( unpacked , "<STR_LIT>" , wheelname ) <EOL> self . assertTrue ( os . path . exists ( created ) , created ) <EOL> def test_pip_install ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> repodir = self . make_setuptools_unpacked ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , repodir , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:.>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , linkdir ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> def test_pip_install_subproject ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> unpacked = self . make_setuptools_subproject_unpacked ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , unpacked , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT:.>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , linkdir ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> def test_pip_install_from_afar ( self ) : <EOL> linkdir = self . make_linkdir ( ) <EOL> repodir = self . make_setuptools_unpacked ( ) <EOL> venv = self . make_venv ( "<STR_LIT>" ) <EOL> self . run_in_venv ( venv , venv , "<STR_LIT>" , "<STR_LIT>" , repodir , <EOL> "<STR_LIT>" , "<STR_LIT>" , linkdir ) <EOL> self . check_in_venv_withlib ( venv ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
