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


Python Git.check_rev_options方法代码示例

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


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

示例1: test_check_rev_options_ref_not_found

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

    new_options = git.check_rev_options('.', rev_options)
    assert new_options.rev == 'develop'
开发者ID:edmorley,项目名称:pip,代码行数:9,代码来源:test_install_vcs_git.py

示例2: test_check_rev_options_ref_exists

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

    new_options = git.check_rev_options('.', rev_options)
    assert new_options.rev == '123456'
开发者ID:edmorley,项目名称:pip,代码行数:9,代码来源:test_install_vcs_git.py

示例3: test_check_rev_options_not_found_warning

# 需要导入模块: from pip._internal.vcs.git import Git [as 别名]
# 或者: from pip._internal.vcs.git.Git import check_rev_options [as 别名]
def test_check_rev_options_not_found_warning(get_sha_mock, caplog):
    get_sha_mock.return_value = None
    git = Git()

    sha = 40 * 'a'
    rev_options = git.make_rev_options(sha)
    new_options = git.check_rev_options('.', rev_options)
    assert new_options.rev == sha

    rev_options = git.make_rev_options(sha[:6])
    new_options = git.check_rev_options('.', 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:edmorley,项目名称:pip,代码行数:21,代码来源:test_install_vcs_git.py

示例4: test_check_rev_options_should_handle_ambiguous_commit

# 需要导入模块: from pip._internal.vcs.git import Git [as 别名]
# 或者: from pip._internal.vcs.git.Git import check_rev_options [as 别名]
def test_check_rev_options_should_handle_ambiguous_commit(get_refs_mock):
    get_refs_mock.return_value = {'master': '123456', '0.1': '123456'}
    git = Git()

    result = git.check_rev_options('0.1', '.', [])
    assert result == ['123456'], result
开发者ID:oz123,项目名称:pip,代码行数:8,代码来源:test_install_vcs_git.py

示例5: test_check_rev_options_should_handle_branch_name

# 需要导入模块: from pip._internal.vcs.git import Git [as 别名]
# 或者: from pip._internal.vcs.git.Git import check_rev_options [as 别名]
def test_check_rev_options_should_handle_branch_name(get_refs_mock):
    get_refs_mock.return_value = {'master': '123456', '0.1': '123456'}
    git = Git()

    result = git.check_rev_options('master', '.', [])
    assert result == ['123456']
开发者ID:oz123,项目名称:pip,代码行数:8,代码来源:test_install_vcs_git.py


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