本文整理汇总了Python中qutebrowser.utils.version._git_str_subprocess函数的典型用法代码示例。如果您正苦于以下问题:Python _git_str_subprocess函数的具体用法?Python _git_str_subprocess怎么用?Python _git_str_subprocess使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_git_str_subprocess函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_exception
def test_exception(self, exc, mocker, tmpdir):
"""Test with subprocess.check_output raising an exception.
Args:
exc: The exception to raise.
"""
m = mocker.patch("qutebrowser.utils.version.os")
m.path.isdir.return_value = True
mocker.patch("qutebrowser.utils.version.subprocess.check_output", side_effect=exc)
ret = version._git_str_subprocess(str(tmpdir))
assert ret is None
示例2: test_missing_dir
def test_missing_dir(self, tmpdir):
"""Test with a directory which doesn't exist."""
ret = version._git_str_subprocess(str(tmpdir / 'does-not-exist'))
assert ret is None
示例3: test_real_git
def test_real_git(self, git_repo):
"""Test with a real git repository."""
ret = version._git_str_subprocess(str(git_repo))
assert ret == 'foobar (1970-01-01 01:00:00 +0100)'