本文整理汇总了Python中qutebrowser.utils.version._os_info函数的典型用法代码示例。如果您正苦于以下问题:Python _os_info函数的具体用法?Python _os_info怎么用?Python _os_info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_os_info函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_unknown_fake
def test_unknown_fake(self, monkeypatch):
"""Test with a fake unknown sys.platform."""
monkeypatch.setattr('qutebrowser.utils.version.sys.platform',
'toaster')
ret = version._os_info()
expected = ['OS Version: ?']
assert ret == expected
开发者ID:t-wissmann,项目名称:qutebrowser,代码行数:7,代码来源:test_version.py
示例2: test_windows_fake
def test_windows_fake(self, monkeypatch):
"""Test with a fake Windows."""
monkeypatch.setattr(version.platform, 'win32_ver',
lambda: ('eggs', 'bacon', 'ham', 'spam'))
ret = version._os_info()
expected = ['OS Version: eggs, bacon, ham, spam']
assert ret == expected
开发者ID:The-Compiler,项目名称:qutebrowser,代码行数:7,代码来源:test_version.py
示例3: test_posix_fake
def test_posix_fake(self, monkeypatch):
"""Test with a fake posix platform."""
uname_tuple = ('PosixOS', 'localhost', '1.0', '1.0', 'i386', 'i386')
monkeypatch.setattr(version.platform, 'uname', lambda: uname_tuple)
ret = version._os_info()
expected = ['OS Version: PosixOS localhost 1.0 1.0 i386 i386']
assert ret == expected
开发者ID:The-Compiler,项目名称:qutebrowser,代码行数:7,代码来源:test_version.py
示例4: test_windows_fake
def test_windows_fake(self, monkeypatch):
"""Test with a fake Windows."""
monkeypatch.setattr("qutebrowser.utils.version.sys.platform", "win32")
monkeypatch.setattr("qutebrowser.utils.version.platform.win32_ver", lambda: ("eggs", "bacon", "ham", "spam"))
ret = version._os_info()
expected = ["OS Version: eggs, bacon, ham, spam"]
assert ret == expected
开发者ID:jcpetkovich,项目名称:qutebrowser,代码行数:7,代码来源:test_version.py
示例5: test_linux_fake
def test_linux_fake(self, monkeypatch):
"""Test with a fake Linux.
No args because osver is set to '' if the OS is linux.
"""
monkeypatch.setattr("qutebrowser.utils.version.sys.platform", "linux")
monkeypatch.setattr("qutebrowser.utils.version._release_info", lambda: [("releaseinfo", "Hello World")])
ret = version._os_info()
expected = ["OS Version: ", "", "--- releaseinfo ---", "Hello World"]
assert ret == expected
开发者ID:jcpetkovich,项目名称:qutebrowser,代码行数:10,代码来源:test_version.py
示例6: test_mac_fake
def test_mac_fake(self, monkeypatch, mac_ver, mac_ver_str):
"""Test with a fake macOS.
Args:
mac_ver: The tuple to set platform.mac_ver() to.
mac_ver_str: The expected Mac version string in version._os_info().
"""
monkeypatch.setattr(version.platform, 'mac_ver', lambda: mac_ver)
ret = version._os_info()
expected = ['OS Version: {}'.format(mac_ver_str)]
assert ret == expected
开发者ID:The-Compiler,项目名称:qutebrowser,代码行数:11,代码来源:test_version.py
示例7: test_linux_fake
def test_linux_fake(self, monkeypatch):
"""Test with a fake Linux.
No args because osver is set to '' if the OS is linux.
"""
monkeypatch.setattr(version, '_release_info',
lambda: [('releaseinfo', 'Hello World')])
ret = version._os_info()
expected = ['OS Version: ', '',
'--- releaseinfo ---', 'Hello World']
assert ret == expected
开发者ID:The-Compiler,项目名称:qutebrowser,代码行数:11,代码来源:test_version.py
示例8: test_os_x_fake
def test_os_x_fake(self, monkeypatch, mac_ver, mac_ver_str):
"""Test with a fake OS X.
Args:
mac_ver: The tuple to set platform.mac_ver() to.
mac_ver_str: The expected Mac version string in version._os_info().
"""
monkeypatch.setattr("qutebrowser.utils.version.sys.platform", "darwin")
monkeypatch.setattr("qutebrowser.utils.version.platform.mac_ver", lambda: mac_ver)
ret = version._os_info()
expected = ["OS Version: {}".format(mac_ver_str)]
assert ret == expected
开发者ID:jcpetkovich,项目名称:qutebrowser,代码行数:12,代码来源:test_version.py
示例9: test_linux_fake
def test_linux_fake(self, monkeypatch, dist, dist_str):
"""Test with a fake Linux.
Args:
dist: The value to set platform.dist() to.
dist_str: The expected distribution string in version._os_info().
"""
monkeypatch.setattr('qutebrowser.utils.version.sys.platform', 'linux')
monkeypatch.setattr('qutebrowser.utils.version._release_info',
lambda: [('releaseinfo', 'Hello World')])
monkeypatch.setattr('qutebrowser.utils.version.platform.dist',
lambda: dist)
ret = version._os_info()
expected = ['OS Version: {}'.format(dist_str), '',
'--- releaseinfo ---', 'Hello World']
assert ret == expected
开发者ID:t-wissmann,项目名称:qutebrowser,代码行数:16,代码来源:test_version.py
示例10: test_os_x_real
def test_os_x_real(self):
"""Make sure there are no exceptions with a real OS X."""
version._os_info()
开发者ID:t-wissmann,项目名称:qutebrowser,代码行数:3,代码来源:test_version.py
示例11: test_windows_real
def test_windows_real(self):
"""Make sure there are no exceptions with a real Windows."""
version._os_info()
开发者ID:t-wissmann,项目名称:qutebrowser,代码行数:3,代码来源:test_version.py
示例12: test_linux_real
def test_linux_real(self):
"""Make sure there are no exceptions with a real Linux."""
version._os_info()
开发者ID:t-wissmann,项目名称:qutebrowser,代码行数:3,代码来源:test_version.py
示例13: test_mac_real
def test_mac_real(self):
"""Make sure there are no exceptions with a real macOS."""
version._os_info()
开发者ID:swalladge,项目名称:qutebrowser,代码行数:3,代码来源:test_version.py
示例14: test_posix_real
def test_posix_real(self):
"""Make sure there are no exceptions with a real posix."""
version._os_info()
开发者ID:The-Compiler,项目名称:qutebrowser,代码行数:3,代码来源:test_version.py
示例15: test_unknown_fake
def test_unknown_fake(self):
"""Test with a fake unknown platform."""
ret = version._os_info()
expected = ['OS Version: ?']
assert ret == expected
开发者ID:The-Compiler,项目名称:qutebrowser,代码行数:5,代码来源:test_version.py
注:本文中的qutebrowser.utils.version._os_info函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论