コード例 #1
0
ファイル: test_mkvirtualenv.py プロジェクト: berdario/pew
def test_create_in_symlink(workon_sym_home):
    invoke('new', 'env', '-d')
    pip_path = Path(invoke('in', 'env', 'which', 'pip').out)
    with pip_path.open() as f:
        pip_shebang = f.readline()
    # check it is using the symlinked path, not the real path
    assert str(workon_sym_home) in pip_shebang
コード例 #2
0
ファイル: test_cp.py プロジェクト: zdndanny/pew
def test_source_relocatable(workon_home, testpackageenv):
    check_call(['virtualenv', '--relocatable', str(workon_home / 'source')])
    invoke('cp', 'source', 'destination', '-d')
    testscript = Path(
        invoke('workon', 'destination', inp='which testscript.py').out.strip())
    assert workon_home / 'destination' / 'bin' / 'testscript.py' == testscript
    invoke('rm', 'destination')
コード例 #3
0
def test_create_in_symlink(workon_sym_home):
    invoke('new', 'env', '-d')
    pip_path = Path(invoke('in', 'env', 'which', 'pip').out)
    with pip_path.open() as f:
        pip_shebang = f.readline()
    # check it is using the symlinked path, not the real path
    assert str(workon_sym_home) in pip_shebang
コード例 #4
0
ファイル: test_cp.py プロジェクト: AndrewPix/pew
def test_new_env_activated(workon_home, testpackageenv):
    invoke('cp', 'source', 'destination', '-d')
    testscript = Path(invoke('in', 'destination', which_cmd, 'testscript.py').out.strip())
    assert ('destination', 'testscript.py') == (testscript.parts[-3], testscript.parts[-1])
    with testscript.open() as f:
        assert str(workon_home / 'destination') in f.read()
    invoke('rm', 'destination')
コード例 #5
0
ファイル: test_cp.py プロジェクト: berdario/pew
def test_source_relocatable(workon_home, testpackageenv):
    check_call([executable, '-m', 'virtualenv', '--relocatable',
                str(workon_home / 'source')])
    invoke('cp', 'source', 'destination', '-d')
    testscript = Path(invoke('workon', 'destination', inp='which testscript.py').out.strip())
    assert workon_home / 'destination' / 'bin' / 'testscript.py' == testscript
    invoke('rm', 'destination')
コード例 #6
0
def test_associate(workon_home):
    project = Path('/dev/null')
    invoke('new', 'env', '-a', str(project), '-d')
    dotproject = workon_home / 'env' / '.project'
    assert dotproject.exists()
    with dotproject.open() as f:
        assert f.read() == str(project.absolute())
    invoke('rm', 'env')
コード例 #7
0
ファイル: test_mkvirtualenv.py プロジェクト: berdario/pew
def test_associate(workon_home):
    project = Path('/dev/null')
    invoke('new', 'env', '-a', str(project), '-d')
    dotproject = workon_home / 'env' / '.project'
    assert dotproject.exists()
    with dotproject.open() as f:
        assert f.read() == str(project.absolute())
    invoke('rm', 'env')
コード例 #8
0
ファイル: test_project.py プロジェクト: Lucas-C/pew
def test_apply_template(project_home, testtemplate):
    projname = 'project1'
    invoke('mkproject', '-t', 'test', projname, '-d')
    testfile = project_home / projname / 'TEST_FILE'
    assert testfile.exists()
    with testfile.open() as f:
        assert projname in f.read()
    invoke('rm', projname)
    rmtree(str(project_home / projname))
コード例 #9
0
ファイル: test_getproject.py プロジェクト: berdario/pew
def test_getproject(env1):
    """Check that ``getproject`` prints an environment's project directory."""
    with temp_environ():
        os.environ.pop('VIRTUAL_ENV', None)
        with TemporaryDirectory() as tmpdir:
            invoke('setproject', 'env1', tmpdir)
            res = invoke('getproject', 'env1')
            assert not res.err
            assert res.out == tmpdir
コード例 #10
0
def test_requirements_file(workon_home):
    with NamedTemporaryFile(delete=False) as temp:
        temp.write(b'IPy')
        temp.close()
        invoke('new', 'env', '-r', temp.name, '-d')
        freeze = invoke('in', 'env', 'pip', 'freeze').out
        assert 'IPy' in freeze
        invoke('rm', 'env')
        unlink(temp.name)
コード例 #11
0
ファイル: test_getproject.py プロジェクト: vjpr/pew
def test_getproject(env1):
    """Check that ``getproject`` prints an environment's project directory."""
    with temp_environ():
        os.environ.pop('VIRTUAL_ENV', None)
        with TemporaryDirectory() as tmpdir:
            invoke('setproject', 'env1', tmpdir)
            res = invoke('getproject', 'env1')
            assert not res.err
            assert res.out == tmpdir
コード例 #12
0
ファイル: test_mkvirtualenv.py プロジェクト: berdario/pew
def test_requirements_file(workon_home):
    with NamedTemporaryFile(delete=False) as temp:
        temp.write(b'IPy')
        temp.close()
        invoke('new', 'env', '-r', temp.name, '-d')
        freeze = invoke('in', 'env', 'pip', 'freeze').out
        assert 'IPy' in freeze
        invoke('rm', 'env')
        unlink(temp.name)
コード例 #13
0
ファイル: test_project.py プロジェクト: virtualtam/pew
def test_apply_template(project_home, testtemplate):
    projname = 'project1'
    invoke('mkproject', '-t', 'test', projname, '-d')
    testfile = project_home / projname / 'TEST_FILE'
    assert testfile.exists()
    with testfile.open() as f:
        assert projname in f.read()
    invoke('rm', projname)
    rmtree(str(project_home / projname))
コード例 #14
0
ファイル: test_cp.py プロジェクト: zdndanny/pew
def test_new_env_activated(workon_home, testpackageenv):
    invoke('cp', 'source', 'destination', '-d')
    testscript = Path(
        invoke('in', 'destination', which_cmd, 'testscript.py').out.strip())
    assert ('destination', 'testscript.py') == (testscript.parts[-3],
                                                testscript.parts[-1])
    with testscript.open() as f:
        assert str(workon_home / 'destination') in f.read()
    invoke('rm', 'destination')
コード例 #15
0
ファイル: test_restore.py プロジェクト: AndrewPix/pew
def test_restore(workon_home, env1):
    patterns = ['lib*/*/site.py*', 'Lib/site.py*']
    to_be_deleted = set(chain(*((workon_home / 'env1').glob(pat) for pat in patterns)))
    for site in to_be_deleted:
        site.unlink()
    result = invoke('in', 'env1', 'python', '-vc', '')
    assert 'Error' in result.err or 'fail' in result.err
    invoke('restore', 'env1')
    result = invoke('in', 'env1', 'python', '-vc', '')
    assert 'Error' not in result.err and 'fail' not in result.err
コード例 #16
0
ファイル: test_restore.py プロジェクト: zdndanny/pew
def test_restore(workon_home, env1):
    patterns = ['lib*/*/site.py*', 'Lib/site.py*']
    to_be_deleted = set(
        chain(*((workon_home / 'env1').glob(pat) for pat in patterns)))
    for site in to_be_deleted:
        site.unlink()
    result = invoke('in', 'env1', 'python', '-vc', '')
    assert 'Error' in result.err or 'fail' in result.err
    invoke('restore', 'env1')
    result = invoke('in', 'env1', 'python', '-vc', '')
    assert 'Error' not in result.err and 'fail' not in result.err
コード例 #17
0
ファイル: test_restore.py プロジェクト: vjpr/pew
def test_restore(workon_home, env1):
    patterns = ['lib*/*/site.py*', 'Lib/site.py*']
    to_be_deleted = set(
        chain(*((workon_home / 'env1').glob(pat) for pat in patterns)))
    for site in to_be_deleted:
        try:
            site.unlink()
        except FileNotFoundError:
            pass  # multiple links to the same file might appear in to_be_deleted
    result = invoke('in', 'env1', 'python', '-vc', '')
    assert 'Error' in result.err or 'fail' in result.err
    invoke('restore', 'env1')
    result = invoke('in', 'env1', 'python', '-vc', '')
    assert 'Error' not in result.err and 'fail' not in result.err
コード例 #18
0
def test_ignore_environ(workon_home, env1, env2):
    with temp_environ():
        os.environ.pop('VIRTUAL_ENV', None)
        with TemporaryDirectory() as tmpdir:
            res = invoke('workon', 'env1', inp='pew setproject env2 ' + tmpdir)
            assert not (workon_home / 'env1' / '.project').exists()
            assert check_project_dir(workon_home, 'env2', tmpdir)
コード例 #19
0
def test_setproject(workon_home, env1):
    with temp_environ():
        os.environ.pop('VIRTUAL_ENV', None)
        with TemporaryDirectory() as tmpdir:
            res = invoke('setproject', 'env1', tmpdir)
            assert not res.err
            assert check_project_dir(workon_home, 'env1', tmpdir)
コード例 #20
0
ファイル: pew.py プロジェクト: aranega/pew
def sitepackages_dir(env=os.environ.get('VIRTUAL_ENV')):
    if not env:
        sys.exit('ERROR: no virtualenv active')
    else:
        env_python = workon_home / env / env_bin_dir / 'python'
        return Path(invoke(str(env_python), '-c', 'import distutils; \
print(distutils.sysconfig.get_python_lib())').out)
コード例 #21
0
ファイル: test_setproject.py プロジェクト: AndrewPix/pew
def test_setproject(workon_home, env1):
    with temp_environ():
        del os.environ['VIRTUAL_ENV']
        with TemporaryDirectory() as tmpdir:
            res = invoke('setproject', 'env1', tmpdir)
            assert not res.err
            assert check_project_dir(workon_home, 'env1', tmpdir)
コード例 #22
0
ファイル: test_setproject.py プロジェクト: AndrewPix/pew
def test_ignore_environ(workon_home, env1, env2):
    with temp_environ():
        del os.environ['VIRTUAL_ENV']
        with TemporaryDirectory() as tmpdir:
            res = invoke('workon', 'env1', inp='pew setproject env2 ' + tmpdir)
            assert not (workon_home / 'env1' / '.project').exists()
            assert check_project_dir(workon_home, 'env2', tmpdir)
コード例 #23
0
def sitepackages_dir(env=os.environ.get('VIRTUAL_ENV')):
    if not env:
        sys.exit('ERROR: no virtualenv active')
    else:
        env_python = workon_home / env / env_bin_dir / 'python'
        return Path(invoke(str(env_python), '-c', 'import distutils; \
print(distutils.sysconfig.get_python_lib())').out)
コード例 #24
0
ファイル: test_setproject.py プロジェクト: berdario/pew
def test_implicit_project(workon_home, env1):
    "use the cwd as project directory"
    with temp_environ():
        os.environ.pop('VIRTUAL_ENV', None)
        with TemporaryDirectory() as tmpdir:
            res = invoke('setproject', 'env1', cwd=tmpdir)
            assert not res.err
            assert check_project_dir(workon_home, 'env1', tmpdir)
コード例 #25
0
ファイル: pew.py プロジェクト: jck/pew
def sitepackages_dir():
    if 'VIRTUAL_ENV' not in os.environ:
        sys.exit('ERROR: no virtualenv active')
    else:
        return Path(
            invoke(
                'python', '-c', 'import distutils; \
print(distutils.sysconfig.get_python_lib())').out)
コード例 #26
0
ファイル: test_workon.py プロジェクト: berdario/pew
def test_workon_no_arg(env1, env2):
    result = invoke('workon')
    out = result.out
    envs = [ x.strip() for x in out.split() ]

    assert 0 == result.returncode
    assert 'env1' in envs
    assert 'env2' in envs
コード例 #27
0
def test_workon_no_arg(env1, env2):
    result = invoke('workon')
    out = result.out
    envs = [ x.strip() for x in out.split() ]

    assert 0 == result.returncode
    assert 'env1' in envs
    assert 'env2' in envs
コード例 #28
0
ファイル: test_setproject.py プロジェクト: taion/pew
def test_implicit_project(workon_home, env1):
    "use the cwd as project directory"
    with temp_environ():
        del os.environ['VIRTUAL_ENV']
        with TemporaryDirectory() as tmpdir:
            res = invoke('setproject', 'env1', cwd=tmpdir)
            assert not res.err
            assert check_project_dir(workon_home, 'env1', tmpdir)
コード例 #29
0
ファイル: pew.py プロジェクト: jck/pew
def wipeenv_cmd():
    """Remove all installed packages from the current env."""
    pkgs = map(lambda d: d.split("==")[0], invoke('pip', 'freeze').out.split())
    to_remove = [pkg for pkg in pkgs if pkg not in ('distribute', 'wsgiref')]
    if to_remove:
        print("Uninstalling packages:\n%s" % "\n".join(to_remove))
        check_call(['pip', 'uninstall', '-y'] + to_remove)
    else:
        print("Nothing to remove")
コード例 #30
0
ファイル: pew.py プロジェクト: jlesquembre/pew
def wipeenv_cmd():
    """Remove all installed packages from the current env."""
    pkgs = map(lambda d: d.split("==")[0], invoke('pip', 'freeze').out.split())
    to_remove = [pkg for pkg in pkgs if pkg not in ('distribute', 'wsgiref')]
    if to_remove:
        print("Uninstalling packages:\n%s" % "\n".join(to_remove))
        check_call(['pip', 'uninstall', '-y'] + to_remove)
    else:
        print("Nothing to remove")
コード例 #31
0
ファイル: pew.py プロジェクト: ryanhiebert/pew
def wipeenv_cmd():
    """Remove all installed packages from the current env."""
    pkgs = map(lambda d: d.split("==")[0], invoke("pip", "freeze").out.split())
    to_remove = [pkg for pkg in pkgs if pkg not in ("distribute", "wsgiref")]
    if to_remove:
        print("Uninstalling packages:\n%s" % "\n".join(to_remove))
        check_call(["pip", "uninstall", "-y"] + to_remove)
    else:
        print("Nothing to remove")
コード例 #32
0
ファイル: pew.py プロジェクト: berdario/pew
def showvirtualenv(env):
    columns, _ = get_terminal_size()
    pkgs = sorted(packages(sitepackages_dir(env)))
    env_python = workon_home / env / env_bin_dir / "python"
    l = len(env) + 2
    version = invoke(str(env_python), "-V")
    version = " - ".join((version.out + version.err).splitlines())
    print(env, ": ", version, sep="")
    print(textwrap.fill(" ".join(pkgs), width=columns - l, initial_indent=(l * " "), subsequent_indent=(l * " ")), "\n")
コード例 #33
0
ファイル: test_getproject.py プロジェクト: berdario/pew
def test_call_without_args_outside_active_venv():
    """Check the error message if called without args outside a virtualenv.

    If ``getproject`` is called without additional arguments outside of
    an active virtualenv, it should print an error message.
    """
    os.environ.pop('VIRTUAL_ENV', None)
    res = invoke('getproject')
    assert not res.out
    assert res.err == "ERROR: no virtualenv active"
コード例 #34
0
ファイル: test_getproject.py プロジェクト: vjpr/pew
def test_call_without_args_outside_active_venv():
    """Check the error message if called without args outside a virtualenv.

    If ``getproject`` is called without additional arguments outside of
    an active virtualenv, it should print an error message.
    """
    os.environ.pop('VIRTUAL_ENV', None)
    res = invoke('getproject')
    assert not res.out
    assert res.err == "ERROR: no virtualenv active"
コード例 #35
0
ファイル: test_getproject.py プロジェクト: berdario/pew
def test_unknown_environment():
    """Check the error message if passed an unknown environment name.

    If ``getproject`` is invoked with the name of an environment that
    does not exist, the call should fail with an appropriate error
    message.
    """
    name = 'bogus-environment-that-/hopefully/-does-not-exist'
    res = invoke('getproject', name)
    assert not res.out
    assert res.err == "ERROR: Environment '{0}' does not exist.".format(name)
コード例 #36
0
ファイル: test_getproject.py プロジェクト: vjpr/pew
def test_unknown_environment():
    """Check the error message if passed an unknown environment name.

    If ``getproject`` is invoked with the name of an environment that
    does not exist, the call should fail with an appropriate error
    message.
    """
    name = 'bogus-environment-that-/hopefully/-does-not-exist'
    res = invoke('getproject', name)
    assert not res.out
    assert res.err == "ERROR: Environment '{0}' does not exist.".format(name)
コード例 #37
0
def showvirtualenv(env):
    columns, _ = get_terminal_size()
    pkgs = sorted(packages(sitepackages_dir(env)))
    env_python = workon_home / env / env_bin_dir / 'python'
    l = len(env) + 2
    version = invoke(str(env_python), '-V')
    version = ' - '.join((version.out + version.err).splitlines())
    print(env, ': ', version, sep='')
    print(textwrap.fill(' '.join(pkgs),
                        width=columns-l,
                        initial_indent=(l * ' '),
                        subsequent_indent=(l * ' ')), '\n')
コード例 #38
0
ファイル: pew.py プロジェクト: aranega/pew
def showvirtualenv(env):
    columns, _ = get_terminal_size()
    pkgs = packages(sitepackages_dir(env))
    env_python = workon_home / env / env_bin_dir / 'python'
    l = len(env) + 2
    version = invoke(str(env_python), '-V')
    version = ' - '.join((version.out + version.err).splitlines())
    print(env, ': ', version, sep='')
    print(textwrap.fill(' '.join(pkgs),
                        width=columns-l,
                        initial_indent=(l * ' '),
                        subsequent_indent=(l * ' ')), '\n')
コード例 #39
0
ファイル: pew.py プロジェクト: ryanhiebert/pew
def sitepackages_dir():
    if "VIRTUAL_ENV" not in os.environ:
        sys.exit("ERROR: no virtualenv active")
    else:
        return Path(
            invoke(
                "python",
                "-c",
                "import distutils; \
print(distutils.sysconfig.get_python_lib())",
            ).out
        )
コード例 #40
0
ファイル: pew.py プロジェクト: berdario/pew
def sitepackages_dir(env=os.environ.get("VIRTUAL_ENV")):
    if not env:
        sys.exit("ERROR: no virtualenv active")
    else:
        env_python = workon_home / env / env_bin_dir / "python"
        return Path(
            invoke(
                str(env_python),
                "-c",
                "import distutils; \
print(distutils.sysconfig.get_python_lib())",
            ).out
        )
コード例 #41
0
ファイル: test_getproject.py プロジェクト: vjpr/pew
def test_project_directory_not_set(env1):
    """Check the error message if no project directory was set.

    If no project directory has been configured for an environment,
    ``getproject`` should quit with an error message.
    """
    name = 'env1'
    with temp_environ():
        os.environ.pop('VIRTUAL_ENV', None)
        with TemporaryDirectory() as tmpdir:
            res = invoke('getproject', name)
            assert not res.out
            assert res.err == (
                "ERROR: no project directory set for Environment '{0}'".format(
                    name))
コード例 #42
0
ファイル: test_getproject.py プロジェクト: berdario/pew
def test_project_directory_not_set(env1):
    """Check the error message if no project directory was set.

    If no project directory has been configured for an environment,
    ``getproject`` should quit with an error message.
    """
    name = 'env1'
    with temp_environ():
        os.environ.pop('VIRTUAL_ENV', None)
        with TemporaryDirectory() as tmpdir:
            res = invoke('getproject', name)
            assert not res.out
            assert res.err == (
                "ERROR: no project directory set for Environment '{0}'"
                .format(name)
            )
コード例 #43
0
ファイル: pew.py プロジェクト: alimuldal/pew
def wipeenv_cmd(argv):
    """Remove all installed packages from the current (or supplied) env."""
    env = argv[0] if argv else os.environ.get('VIRTUAL_ENV')

    if not env:
        sys.exit('ERROR: no virtualenv active')
    elif not (workon_home / env).exists():
        sys.exit("ERROR: Environment '{0}' does not exist.".format(env))
    else:
        env_pip = str(workon_home / env / env_bin_dir / 'pip')
        all_pkgs = set(invoke(env_pip, 'freeze').out.splitlines())
        pkgs = set(p for p in all_pkgs if len(p.split("==")) == 2)
        ignored = sorted(all_pkgs - pkgs)
        pkgs = set(p.split("==")[0] for p in pkgs)
        to_remove = sorted(pkgs - set(['distribute', 'wsgiref']))
        if to_remove:
            print("Ignoring:\n %s" % "\n ".join(ignored))
            print("Uninstalling packages:\n %s" % "\n ".join(to_remove))
            inve(env, 'pip', 'uninstall', '-y', *to_remove)
        else:
            print("Nothing to remove")
コード例 #44
0
ファイル: pew.py プロジェクト: berdario/pew
def wipeenv_cmd(argv):
    """Remove all installed packages from the current (or supplied) env."""
    env = argv[0] if argv else os.environ.get("VIRTUAL_ENV")

    if not env:
        sys.exit("ERROR: no virtualenv active")
    elif not (workon_home / env).exists():
        sys.exit("ERROR: Environment '{0}' does not exist.".format(env))
    else:
        env_pip = str(workon_home / env / env_bin_dir / "pip")
        all_pkgs = set(invoke(env_pip, "freeze").out.splitlines())
        pkgs = set(p for p in all_pkgs if len(p.split("==")) == 2)
        ignored = sorted(all_pkgs - pkgs)
        pkgs = set(p.split("==")[0] for p in pkgs)
        to_remove = sorted(pkgs - set(["distribute", "wsgiref"]))
        if to_remove:
            print("Ignoring:\n %s" % "\n ".join(ignored))
            print("Uninstalling packages:\n %s" % "\n ".join(to_remove))
            inve(env, "pip", "uninstall", "-y", *to_remove)
        else:
            print("Nothing to remove")
コード例 #45
0
ファイル: test_wipe.py プロジェクト: AndrewPix/pew
def test_wipe(env1):
    assert not invoke('in', 'env1', 'pip', 'install', 'WebTest').err
    assert 'WebTest' in invoke('in', 'env1', 'pip', 'freeze').out
    invoke('wipeenv', 'env1')
    assert 'WebTest' not in invoke('in', 'env1', 'pip', 'freeze').out
コード例 #46
0
ファイル: test_rmvirtualenv.py プロジェクト: berdario/pew
def test_no_such_env(workon_home):
    assert not (workon_home / 'not_here').exists()
    assert invoke('rm', 'not_here').returncode != 0
コード例 #47
0
def env1(workon_home):
    invoke('new', 'env1', '-d')
    yield
    invoke('rm', 'env1')
コード例 #48
0
def env2(workon_home):
    invoke('new', 'env2', '-d')
    yield
    invoke('rm', 'env2')
コード例 #49
0
def testpackageenv(workon_home):
    testpackage = str(Path(__file__).parent / 'testpackage')
    invoke('new', 'source', '-d')
    invoke('in', 'source', 'python', 'setup.py', 'install', cwd=testpackage)
    yield
    invoke('rm', 'source')
コード例 #50
0
ファイル: test_project.py プロジェクト: virtualtam/pew
def project(workon_home, project_home):
    projname = 'project1'
    invoke('mkproject', projname, '-d')
    yield projname
    invoke('rm', projname)
    rmtree(str(project_home / projname))
コード例 #51
0
def test_create(workon_home):
    envs = set(invoke('ls').out.split())
    invoke('new', 'env', '-d')
    envs2 = set(invoke('in', 'env', 'pew', 'ls').out.split())
    invoke('rm', 'env')
    assert envs < envs2
コード例 #52
0
ファイル: test_project.py プロジェクト: virtualtam/pew
def test_list_templates(testtemplate):
    assert 'test' in invoke('mkproject', '-l').out
コード例 #53
0
ファイル: test_rmvirtualenv.py プロジェクト: berdario/pew
def test_remove(to_be_deleted):
    invoke('rm', to_be_deleted)
コード例 #54
0
def test_install_2pkgs(workon_home):
    invoke('new', 'env', '-i', 'IPy', '-i', 'WebTest', '-d')
    freeze = invoke('in', 'env', 'pip', 'freeze').out
    assert 'IPy' in freeze
    assert 'WebTest' in freeze
    invoke('rm', 'env')
コード例 #55
0
ファイル: test_mkvirtualenv.py プロジェクト: berdario/pew
def test_create(workon_home):
    envs = set(invoke('ls').out.split())
    invoke('new', 'env', '-d')
    envs2 = set(invoke('in', 'env', 'pew', 'ls').out.split())
    invoke('rm', 'env')
    assert envs < envs2
コード例 #56
0
def test_gsp(workon_home):
    invoke('new', 'env', '--system-site-packages', '-d')
    site = invoke('in', 'env', 'pew', 'sitepackages_dir').out
    assert not (Path(site).parent / 'no-global-site-packages.txt').exists()
    invoke('rm', 'env')
コード例 #57
0
ファイル: test_rmvirtualenv.py プロジェクト: berdario/pew
def to_be_deleted(workon_home):
    envname = 'to_be_deleted'
    invoke('new', envname, '-d')
    yield envname
    assert not (workon_home / envname).exists()
コード例 #58
0
ファイル: test_project.py プロジェクト: virtualtam/pew
def test_create_virtualenv(project_home, project):
    env = Path(invoke('in', project, *check_env).out)
    assert project == env.name
    with (env / '.project').open() as f:
        assert str(project_home.absolute() / project) == f.read().strip()
コード例 #59
0
ファイル: test_mkvirtualenv.py プロジェクト: berdario/pew
def test_gsp(workon_home):
    invoke('new', 'env', '--system-site-packages', '-d')
    site = invoke('in', 'env', 'pew', 'sitepackages_dir').out
    assert not (Path(site).parent / 'no-global-site-packages.txt').exists()
    invoke('rm', 'env')
コード例 #60
0
ファイル: test_mkvirtualenv.py プロジェクト: berdario/pew
def test_install_2pkgs(workon_home):
    invoke('new', 'env', '-i', 'IPy', '-i', 'WebTest', '-d')
    freeze = invoke('in', 'env', 'pip', 'freeze').out
    assert 'IPy' in freeze
    assert 'WebTest' in freeze
    invoke('rm', 'env')