Beispiel #1
0
def test_pip_cmd_root(pip_ver, cmd_type):
    """Verify correct determination of the command root by pip version."""
    exp_cmd = (
        'pip',
        '-q',
        'install' if cmd_type == 'i' else 'download',
    )
    assert tuple(PipCmd.update_root(pip_ver)) == exp_cmd
Beispiel #2
0
def test_pip_cmd_root(pip_ver, cmd_type):
    """Verify correct determination of the command root by pip version."""
    exp_cmd = (
        "pip",
        "-q",
        "install" if cmd_type == "i" else "download",
    )
    assert tuple(PipCmd.update_root(pip_ver)) == exp_cmd
Beispiel #3
0
def test_pip_cmd_update_index_overridden():
    """Verify the correct determination of a pip command."""
    index = 'https://pypi.org/complex'
    destdir = 'foo/bar'
    pkg_name = 'mypkg'
    pkg_version = '12.0'
    cmd_root = ('pip', '-q', 'download')
    exp_cmd = cmd_root + ('--no-deps', '-i', index, '-d', destdir,
                          '{}=={}'.format(pkg_name, pkg_version))
    assert exp_cmd == tuple(
        PipCmd.update(cmd_root, destdir, pkg_name, pkg_version, index=index))
Beispiel #4
0
def test_pip_cmd_update_index_overridden():
    """Verify the correct determination of a pip command."""
    index = "https://pypi.org/complex"
    destdir = "foo/bar"
    pkg_name = "mypkg"
    pkg_version = "12.0"
    cmd_root = ("pip", "-q", "download")
    exp_cmd = cmd_root + (
        "--no-deps",
        "-i",
        index,
        "-d",
        destdir,
        "{}=={}".format(pkg_name, pkg_version),
    )
    assert exp_cmd == tuple(
        PipCmd.update(cmd_root, destdir, pkg_name, pkg_version, index=index))