def create(name, sitepackages, prompt): ''' create rvirtualenv ''' venv = path.join(os.getcwd(), name) copy(venv) generate(venv, sitepackages=sitepackages, prompt=prompt)
def test_whole_generate(self): generate(self.virtualenv) pybin = path.join(get_script_path(self.virtualenv), 'python.py') self.assertTrue(path.exists(pybin)) pyrc = path.join(self.virtualenv, 'pythonrc.py') self.assertTrue(path.exists(pyrc)) content = open(pyrc, 'r').read() self.assertFalse('# INSERT LIB DIRS HERE' in content)
def main(argv=None): ''' main call for rvirtualenv command ''' if argv is None: argv = sys.argv if len(argv) < 2: raise NotImplementedError venv = argv[1] copy(venv) generate(venv)
def test_whole_generate(self, layout=None): copy(self.virtualenv) generate(self.virtualenv, layout=layout) structure = store_directory_structure(self.virtualenv, content='<file>') if layout is None: layout = guess_scheme() paths = set((i for i,j in structure)) vars = {'base': self.virtualenv} self.assertTrue(get_scheme(layout, 'purelib', vars=vars) in paths) self.assertTrue(get_scheme(layout, 'scripts', vars=vars) in paths) pybin = path.join(get_scheme(layout, 'scripts', vars=vars), 'python.py') self.assertTrue(path.exists(pybin)) pyrc = path.join(self.virtualenv, 'pythonrc.py') self.assertTrue(path.exists(pyrc)) content = open(pyrc, 'r').read() self.assertFalse("scheme = 'custom'" in content)
def test_whole_generate(self, layout=None): copy(self.virtualenv) generate(self.virtualenv, layout=layout) structure = store_directory_structure(self.virtualenv, content='<file>') if layout is None: layout = guess_scheme() paths = set((i for i, j in structure)) vars = {'base': self.virtualenv} self.assertTrue(get_scheme(layout, 'purelib', vars=vars) in paths) self.assertTrue(get_scheme(layout, 'scripts', vars=vars) in paths) pybin = path.join(get_scheme(layout, 'scripts', vars=vars), 'python.py') self.assertTrue(path.exists(pybin)) pyrc = path.join(self.virtualenv, 'pythonrc.py') self.assertTrue(path.exists(pyrc)) content = open(pyrc, 'r').read() self.assertFalse("scheme = 'custom'" in content)