当前位置: 首页>>代码示例>>Python>>正文


Python lib._change_test_package_version函数代码示例

本文整理汇总了Python中tests.lib._change_test_package_version函数的典型用法代码示例。如果您正苦于以下问题:Python _change_test_package_version函数的具体用法?Python _change_test_package_version怎么用?Python _change_test_package_version使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了_change_test_package_version函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_reinstalling_works_with_editible_non_master_branch

def test_reinstalling_works_with_editible_non_master_branch(script):
    """
    Reinstalling an editable installation should not assume that the "master"
    branch exists. See https://github.com/pypa/pip/issues/4448.
    """
    version_pkg_path = _create_test_package(script)

    # Switch the default branch to something other than 'master'
    script.run('git', 'branch', '-m', 'foobar', cwd=version_pkg_path)

    script.pip(
        'install', '-e',
        '%s#egg=version_pkg' %
        ('git+file://' + version_pkg_path.abspath.replace('\\', '/')),
    )
    version = script.run('version_pkg')
    assert '0.1' in version.stdout

    _change_test_package_version(script, version_pkg_path)
    script.pip(
        'install', '-e',
        '%s#egg=version_pkg' %
        ('git+file://' + version_pkg_path.abspath.replace('\\', '/')),
    )
    version = script.run('version_pkg')
    assert 'some different version' in version.stdout
开发者ID:vtitor,项目名称:pip,代码行数:26,代码来源:test_install_vcs.py

示例2: test_git_with_tag_name_as_revision

def test_git_with_tag_name_as_revision(script):
    """
    Git backend should be able to install from tag names
    """
    version_pkg_path = _create_test_package(script)
    script.run('git', 'tag', 'test_tag', expect_stderr=True, cwd=version_pkg_path)
    _change_test_package_version(script, version_pkg_path)
    script.pip('install', '-e', '%[email protected]_tag#egg=version_pkg' % ('git+file://' + version_pkg_path.abspath.replace('\\', '/')))
    version = script.run('version_pkg')
    assert '0.1' in version.stdout
开发者ID:1stvamp,项目名称:pip,代码行数:10,代码来源:test_install_vcs.py

示例3: test_git_with_branch_name_as_revision

def test_git_with_branch_name_as_revision(script):
    """
    Git backend should be able to install from branch names
    """
    version_pkg_path = _create_test_package(script)
    script.run('git', 'checkout', '-b', 'test_branch', expect_stderr=True, cwd=version_pkg_path)
    _change_test_package_version(script, version_pkg_path)
    script.pip('install', '-e', '%[email protected]_branch#egg=version_pkg' % ('git+file://' + version_pkg_path.abspath.replace('\\', '/')))
    version = script.run('version_pkg')
    assert 'some different version' in version.stdout
开发者ID:1stvamp,项目名称:pip,代码行数:10,代码来源:test_install_vcs.py

示例4: test_git_with_sha1_revisions

def test_git_with_sha1_revisions(script):
    """
    Git backend should be able to install from SHA1 revisions
    """
    version_pkg_path = _create_test_package(script)
    _change_test_package_version(script, version_pkg_path)
    sha1 = script.run('git', 'rev-parse', 'HEAD~1', cwd=version_pkg_path).stdout.strip()
    script.pip('install', '-e', '%[email protected]%s#egg=version_pkg' % ('git+file://' + version_pkg_path.abspath.replace('\\', '/'), sha1))
    version = script.run('version_pkg')
    assert '0.1' in version.stdout, version.stdout
开发者ID:1stvamp,项目名称:pip,代码行数:10,代码来源:test_install_vcs.py

示例5: test_git_install_branch_again_after_branch_changes

def test_git_install_branch_again_after_branch_changes(script):
    """
    Test installing a branch again after the branch is updated in the remote
    repository.
    """
    version_pkg_path = _create_test_package(script)
    version = _install_version_pkg(script, version_pkg_path, rev='master')
    assert version == '0.1'

    _change_test_package_version(script, version_pkg_path)
    version = _install_version_pkg(script, version_pkg_path, rev='master')
    assert version == 'some different version'
开发者ID:jonparrott,项目名称:pip,代码行数:12,代码来源:test_install_vcs_git.py

示例6: test_git_install_ref

def test_git_install_ref(script):
    """
    The Git backend should be able to install a ref with the first install.
    """
    version_pkg_path = _create_test_package(script)
    _add_ref(script, version_pkg_path, 'refs/foo/bar')
    _change_test_package_version(script, version_pkg_path)

    version = _install_version_pkg(
        script, version_pkg_path, rev='refs/foo/bar', expect_stderr=True,
    )
    assert '0.1' == version
开发者ID:jonparrott,项目名称:pip,代码行数:12,代码来源:test_install_vcs_git.py

示例7: test_editable_git_upgrade

def test_editable_git_upgrade(script):
    """
    Test installing an editable git package from a repository, upgrading the repository,
    installing again, and check it gets the newer version
    """
    version_pkg_path = _create_test_package(script)
    script.pip('install', '-e', '%s#egg=version_pkg' % ('git+file://' + version_pkg_path))
    version = script.run('version_pkg')
    assert '0.1' in version.stdout
    _change_test_package_version(script, version_pkg_path)
    script.pip('install', '-e', '%s#egg=version_pkg' % ('git+file://' + version_pkg_path))
    version2 = script.run('version_pkg')
    assert 'some different version' in version2.stdout, "Output: %s" % (version2.stdout)
开发者ID:1stvamp,项目名称:pip,代码行数:13,代码来源:test_install_upgrade.py

示例8: test_git_with_sha1_revisions

def test_git_with_sha1_revisions():
    """
    Git backend should be able to install from SHA1 revisions
    """
    env = reset_env()
    version_pkg_path = _create_test_package(env)
    _change_test_package_version(env, version_pkg_path)
    sha1 = env.run("git", "rev-parse", "HEAD~1", cwd=version_pkg_path).stdout.strip()
    run_pip(
        "install", "-e", "%[email protected]%s#egg=version_pkg" % ("git+file://" + version_pkg_path.abspath.replace("\\", "/"), sha1)
    )
    version = env.run("version_pkg")
    assert "0.1" in version.stdout, version.stdout
开发者ID:ncoghlan,项目名称:pip,代码行数:13,代码来源:test_install_vcs.py

示例9: test_git_with_tag_name_as_revision

def test_git_with_tag_name_as_revision(script):
    """
    Git backend should be able to install from tag names
    """
    version_pkg_path = _create_test_package(script)
    script.run(
        'git', 'tag', 'test_tag',
        expect_stderr=True,
        cwd=version_pkg_path,
    )
    _change_test_package_version(script, version_pkg_path)
    version = _install_version_pkg(script, version_pkg_path, rev='test_tag')
    assert '0.1' == version
开发者ID:jonparrott,项目名称:pip,代码行数:13,代码来源:test_install_vcs_git.py

示例10: test_git_with_tag_name_as_revision

def test_git_with_tag_name_as_revision():
    """
    Git backend should be able to install from tag names
    """
    env = reset_env()
    version_pkg_path = _create_test_package(env)
    env.run("git", "tag", "test_tag", expect_stderr=True, cwd=version_pkg_path)
    _change_test_package_version(env, version_pkg_path)
    run_pip(
        "install", "-e", "%[email protected]_tag#egg=version_pkg" % ("git+file://" + version_pkg_path.abspath.replace("\\", "/"))
    )
    version = env.run("version_pkg")
    assert "0.1" in version.stdout
开发者ID:ncoghlan,项目名称:pip,代码行数:13,代码来源:test_install_vcs.py

示例11: test_git_with_branch_name_as_revision

def test_git_with_branch_name_as_revision(script):
    """
    Git backend should be able to install from branch names
    """
    version_pkg_path = _create_test_package(script)
    branch = 'test_branch'
    script.run(
        'git', 'checkout', '-b', branch,
        expect_stderr=True,
        cwd=version_pkg_path,
    )
    _change_test_package_version(script, version_pkg_path)
    version = _install_version_pkg(script, version_pkg_path, rev=branch)
    assert 'some different version' == version
开发者ID:jonparrott,项目名称:pip,代码行数:14,代码来源:test_install_vcs_git.py

示例12: test_git_with_short_sha1_revisions

def test_git_with_short_sha1_revisions(script):
    """
    Git backend should be able to install from SHA1 revisions
    """
    version_pkg_path = _create_test_package(script)
    _change_test_package_version(script, version_pkg_path)
    sha1 = script.run(
        'git', 'rev-parse', 'HEAD~1',
        cwd=version_pkg_path,
    ).stdout.strip()[:7]
    version = _install_version_pkg(
        script, version_pkg_path, rev=sha1, expect_stderr=True,
    )
    assert '0.1' == version
开发者ID:jonparrott,项目名称:pip,代码行数:14,代码来源:test_install_vcs_git.py

示例13: test_editable_git_upgrade

def test_editable_git_upgrade():
    """
    Test installing an editable git package from a repository, upgrading the repository,
    installing again, and check it gets the newer version
    """
    env = reset_env()
    version_pkg_path = _create_test_package(env)
    run_pip("install", "-e", "%s#egg=version_pkg" % ("git+file://" + version_pkg_path))
    version = env.run("version_pkg")
    assert "0.1" in version.stdout
    _change_test_package_version(env, version_pkg_path)
    run_pip("install", "-e", "%s#egg=version_pkg" % ("git+file://" + version_pkg_path))
    version2 = env.run("version_pkg")
    assert "some different version" in version2.stdout, "Output: %s" % (version2.stdout)
开发者ID:Basis,项目名称:pip,代码行数:14,代码来源:test_install_upgrade.py

示例14: test_git_with_branch_name_as_revision

def test_git_with_branch_name_as_revision():
    """
    Git backend should be able to install from branch names
    """
    env = reset_env()
    version_pkg_path = _create_test_package(env)
    env.run("git", "checkout", "-b", "test_branch", expect_stderr=True, cwd=version_pkg_path)
    _change_test_package_version(env, version_pkg_path)
    run_pip(
        "install",
        "-e",
        "%[email protected]_branch#egg=version_pkg" % ("git+file://" + version_pkg_path.abspath.replace("\\", "/")),
    )
    version = env.run("version_pkg")
    assert "some different version" in version.stdout
开发者ID:ncoghlan,项目名称:pip,代码行数:15,代码来源:test_install_vcs.py

示例15: test_reinstalling_works_with_editable_non_master_branch

def test_reinstalling_works_with_editable_non_master_branch(script):
    """
    Reinstalling an editable installation should not assume that the "master"
    branch exists. See https://github.com/pypa/pip/issues/4448.
    """
    version_pkg_path = _create_test_package(script)

    # Switch the default branch to something other than 'master'
    script.run('git', 'branch', '-m', 'foobar', cwd=version_pkg_path)

    version = _install_version_pkg(script, version_pkg_path)
    assert '0.1' == version

    _change_test_package_version(script, version_pkg_path)
    version = _install_version_pkg(script, version_pkg_path)
    assert 'some different version' == version
开发者ID:jonparrott,项目名称:pip,代码行数:16,代码来源:test_install_vcs_git.py


注:本文中的tests.lib._change_test_package_version函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。