debug.sysinfo: tests and coverage

This commit is contained in:
Aldo Cortesi 2016-06-11 17:56:17 +12:00
parent e367b88195
commit 5b9f07c81c
2 changed files with 15 additions and 6 deletions

View File

@ -12,15 +12,18 @@ def sysinfo():
"Platform: %s"%platform.platform(),
]
d = platform.linux_distribution()
if d[0]:
data.append("Linux distro: %s %s %s"%d)
t = "Linux distro: %s %s %s"%d
if d[0]: # pragma: no-cover
data.append(t)
d = platform.mac_ver()
if d[0]:
data.append("Mac version: %s %s %s"%d)
t = "Mac version: %s %s %s"%d
if d[0]: # pragma: no-cover
data.append(t)
d = platform.win32_ver()
if d[0]:
data.append("Windows version: %s %s %s %s"%d)
t = "Windows version: %s %s %s %s"%d
if d[0]: # pragma: no-cover
data.append(t)
return "\n".join(data)

View File

@ -0,0 +1,6 @@
from netlib import debug
def test_sysinfo():
assert debug.sysinfo()