• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python lib._change_test_package_version函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: test_git_install_again_after_changes

def test_git_install_again_after_changes(script):
    """
    Test installing a repository a second time without specifying a revision,
    and after updates to the remote repository.

    This test also checks that no warning message like the following gets
    logged on the update: "Did not find branch or tag ..., assuming ref or
    revision."
    """
    version_pkg_path = _create_test_package(script)
    version = _install_version_pkg(script, version_pkg_path)
    assert version == '0.1'

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


示例17: test_git_with_ref_as_revision

def test_git_with_ref_as_revision(script):
    """
    Git backend should be able to install from a ref
    """
    version_pkg_path = _create_test_package(script)
    script.run(
        'git', 'update-ref', 'refs/foo/bar', 'HEAD',
        expect_stderr=True,
        cwd=version_pkg_path,
    )
    _change_test_package_version(script, version_pkg_path)
    script.pip(
        'install', '-e', '%[email protected]/foo/bar#egg=version_pkg' %
        ('git+file://' + version_pkg_path.abspath.replace('\\', '/')),
        expect_stderr=True
    )
    version = script.run('version_pkg')
    assert '0.1' in version.stdout
开发者ID:vtitor,项目名称:pip,代码行数:18,代码来源:test_install_vcs.py


示例18: test_git_install_then_install_ref

def test_git_install_then_install_ref(script):
    """
    The Git backend should be able to install a ref after a package has
    already been installed.
    """
    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, expect_stderr=True,
    )
    assert 'some different version' == version

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


示例19: test_editable__branch_with_sha_different_from_default

def test_editable__branch_with_sha_different_from_default(script):
    """
    Test installing in editable mode a branch whose sha is different from
    the sha of the default branch.
    """
    version_pkg_path = _create_test_package(script)
    # Create a second branch.
    script.run(
        'git', 'branch', 'develop', expect_stderr=True,
        cwd=version_pkg_path,
    )
    # Add another commit to the master branch to give it a different sha.
    _change_test_package_version(script, version_pkg_path)

    version = _install_version_pkg(
        script, version_pkg_path, rev='develop', expect_stderr=True
    )
    assert version == '0.1'

    branch = _get_editable_branch(script, 'version-pkg')
    assert branch == 'develop'

    remote = _get_branch_remote(script, 'version-pkg', 'develop')
    assert remote == 'origin'
开发者ID:jonparrott,项目名称:pip,代码行数:24,代码来源:test_install_vcs_git.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python lib._create_test_package函数代码示例发布时间:2022-05-27
下一篇:
Python tools.add_action函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap