From 5b9f07c81c0dcc8c7b3d7afdeae8f6229ebf8622 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 11 Jun 2016 17:56:17 +1200 Subject: [PATCH] debug.sysinfo: tests and coverage --- netlib/debug.py | 15 +++++++++------ test/netlib/test_debug.py | 6 ++++++ 2 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 test/netlib/test_debug.py diff --git a/netlib/debug.py b/netlib/debug.py index ca25b8287..bf446eb03 100644 --- a/netlib/debug.py +++ b/netlib/debug.py @@ -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) diff --git a/test/netlib/test_debug.py b/test/netlib/test_debug.py new file mode 100644 index 000000000..d174bb5fd --- /dev/null +++ b/test/netlib/test_debug.py @@ -0,0 +1,6 @@ + +from netlib import debug + + +def test_sysinfo(): + assert debug.sysinfo()