Ejemplo n.º 1
0
def test_install_special_deps(venv, mocker, actioncls):
    """
    Test that nothing is called when there are no deps
    """
    action = actioncls()
    venv.deps = ["foo-package", "foo-two-package"]
    mocker.patch.object(os, "environ", autospec=True)
    mocker.patch("subprocess.Popen")
    result = tox_testenv_install_deps(venv, action)
    assert result == True
    assert subprocess.Popen.call_count == 1
    subprocess.Popen.assert_called_once_with(
        [
            sys.executable,
            "-m",
            "pipenv",
            "install",
            "--dev",
            "foo-package",
            "foo-two-package",
        ],
        action=action,
        cwd=venv.path.dirpath(),
        venv=False,
    )
Ejemplo n.º 2
0
def test_install_pip_ignore_pipfile(venv, mocker, actioncls):
    """
    Test that --ignore-pipfile flag is passed to pipenv executable
    """
    action = actioncls(venv)

    mocker.patch.object(os, "environ", autospec=True)
    mocker.patch.object(action.venv.envconfig, 'ignore_pipfile', True)
    mocker.patch("subprocess.Popen")
    result = tox_testenv_install_deps(venv, action)
    assert result == True
    assert subprocess.Popen.call_count == 1
    subprocess.Popen.assert_called_once_with(
        [
            sys.executable,
            "-m",
            "pipenv",
            "install",
            "--dev",
            "--ignore-pipfile",
            "--keep-outdated",
        ],
        action=action,
        cwd=venv.path.dirpath(),
        venv=False,
    )
Ejemplo n.º 3
0
def test_install_no_deps(venv, mocker, actioncls):
    """
    Test that nothing is called when there are no deps
    """
    action = actioncls()
    venv.deps = []
    mocker.patch.object(os, "environ", autospec=True)
    mocker.patch("subprocess.Popen")
    result = tox_testenv_install_deps(venv, action)
    assert result == True
    assert subprocess.Popen.call_count == 0