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


Python Git.resolve_revision方法代码示例

本文整理汇总了Python中pip._internal.vcs.git.Git.resolve_revision方法的典型用法代码示例。如果您正苦于以下问题:Python Git.resolve_revision方法的具体用法?Python Git.resolve_revision怎么用?Python Git.resolve_revision使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pip._internal.vcs.git.Git的用法示例。


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

示例1: test_git_resolve_revision_rev_not_found

# 需要导入模块: from pip._internal.vcs.git import Git [as 别名]
# 或者: from pip._internal.vcs.git.Git import resolve_revision [as 别名]
def test_git_resolve_revision_rev_not_found(get_sha_mock):
    get_sha_mock.return_value = (None, False)
    url = 'git+https://git.example.com'
    rev_options = Git.make_rev_options('develop')

    new_options = Git.resolve_revision('.', url, rev_options)
    assert new_options.rev == 'develop'
开发者ID:pypa,项目名称:pip,代码行数:9,代码来源:test_vcs.py

示例2: test_git_resolve_revision_rev_exists

# 需要导入模块: from pip._internal.vcs.git import Git [as 别名]
# 或者: from pip._internal.vcs.git.Git import resolve_revision [as 别名]
def test_git_resolve_revision_rev_exists(get_sha_mock):
    get_sha_mock.return_value = ('123456', False)
    git = Git()
    rev_options = git.make_rev_options('develop')

    url = 'git+https://git.example.com'
    new_options = git.resolve_revision('.', url, rev_options)
    assert new_options.rev == '123456'
开发者ID:jaraco,项目名称:pip,代码行数:10,代码来源:test_vcs.py

示例3: test_git_resolve_revision_not_found_warning

# 需要导入模块: from pip._internal.vcs.git import Git [as 别名]
# 或者: from pip._internal.vcs.git.Git import resolve_revision [as 别名]
def test_git_resolve_revision_not_found_warning(get_sha_mock, caplog):
    get_sha_mock.return_value = (None, False)
    url = 'git+https://git.example.com'
    sha = 40 * 'a'
    rev_options = Git.make_rev_options(sha)

    new_options = Git.resolve_revision('.', url, rev_options)
    assert new_options.rev == sha

    rev_options = Git.make_rev_options(sha[:6])
    new_options = Git.resolve_revision('.', url, rev_options)
    assert new_options.rev == 'aaaaaa'

    # Check that a warning got logged only for the abbreviated hash.
    messages = [r.getMessage() for r in caplog.records]
    messages = [msg for msg in messages if msg.startswith('Did not find ')]
    assert messages == [
        "Did not find branch or tag 'aaaaaa', assuming revision or ref."
    ]
开发者ID:pypa,项目名称:pip,代码行数:21,代码来源:test_vcs.py


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