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


Python version._git_str_subprocess函数代码示例

本文整理汇总了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
开发者ID:jcpetkovich,项目名称:qutebrowser,代码行数:11,代码来源:test_version.py

示例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
开发者ID:t-wissmann,项目名称:qutebrowser,代码行数:4,代码来源:test_version.py

示例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)'
开发者ID:t-wissmann,项目名称:qutebrowser,代码行数:4,代码来源:test_version.py


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