本文整理汇总了Python中pip._internal.vcs.git.Git.is_commit_id_equal方法的典型用法代码示例。如果您正苦于以下问题:Python Git.is_commit_id_equal方法的具体用法?Python Git.is_commit_id_equal怎么用?Python Git.is_commit_id_equal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pip._internal.vcs.git.Git
的用法示例。
在下文中一共展示了Git.is_commit_id_equal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_is_commit_id_equal
# 需要导入模块: from pip._internal.vcs.git import Git [as 别名]
# 或者: from pip._internal.vcs.git.Git import is_commit_id_equal [as 别名]
def test_is_commit_id_equal(script):
"""
Test Git.is_commit_id_equal().
"""
version_pkg_path = _create_test_package(script)
script.run('git', 'branch', 'branch0.1', cwd=version_pkg_path)
commit = script.run(
'git', 'rev-parse', 'HEAD',
cwd=version_pkg_path
).stdout.strip()
assert Git.is_commit_id_equal(version_pkg_path, commit)
assert not Git.is_commit_id_equal(version_pkg_path, commit[:7])
assert not Git.is_commit_id_equal(version_pkg_path, 'branch0.1')
assert not Git.is_commit_id_equal(version_pkg_path, 'abc123')
# Also check passing a None value.
assert not Git.is_commit_id_equal(version_pkg_path, None)
示例2: test_git_is_commit_id_equal
# 需要导入模块: from pip._internal.vcs.git import Git [as 别名]
# 或者: from pip._internal.vcs.git.Git import is_commit_id_equal [as 别名]
def test_git_is_commit_id_equal(mock_get_revision, rev_name, result):
"""
Test Git.is_commit_id_equal().
"""
mock_get_revision.return_value = '5547fa909e83df8bd743d3978d6667497983a4b7'
assert Git.is_commit_id_equal('/path', rev_name) is result