diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-06-11 17:56:17 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-06-11 17:56:17 +1200 |
commit | 5b9f07c81c0dcc8c7b3d7afdeae8f6229ebf8622 (patch) | |
tree | 854564b30ea2bc3474d1cfd33feb8c862244db18 | |
parent | e367b8819569a7811d2625a2b59610b508e8175c (diff) | |
download | mitmproxy-5b9f07c81c0dcc8c7b3d7afdeae8f6229ebf8622.tar.gz mitmproxy-5b9f07c81c0dcc8c7b3d7afdeae8f6229ebf8622.tar.bz2 mitmproxy-5b9f07c81c0dcc8c7b3d7afdeae8f6229ebf8622.zip |
debug.sysinfo: tests and coverage
-rw-r--r-- | netlib/debug.py | 15 | ||||
-rw-r--r-- | test/netlib/test_debug.py | 6 |
2 files changed, 15 insertions, 6 deletions
diff --git a/netlib/debug.py b/netlib/debug.py index ca25b828..bf446eb0 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 00000000..d174bb5f --- /dev/null +++ b/test/netlib/test_debug.py @@ -0,0 +1,6 @@ + +from netlib import debug + + +def test_sysinfo(): + assert debug.sysinfo() |