From a5d74356dda2f34d9bebf3a3276f5f7d1869985a Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 23 Oct 2017 18:24:06 +0200 Subject: simplify version output --- test/mitmproxy/utils/test_debug.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/mitmproxy/utils/test_debug.py b/test/mitmproxy/utils/test_debug.py index 4371ef70..a8e1054d 100644 --- a/test/mitmproxy/utils/test_debug.py +++ b/test/mitmproxy/utils/test_debug.py @@ -11,13 +11,19 @@ from mitmproxy.utils import debug def test_dump_system_info_precompiled(precompiled): sys.frozen = None with mock.patch.object(sys, 'frozen', precompiled): - assert ("Precompiled Binary" in debug.dump_system_info()) == precompiled + assert ("binary" in debug.dump_system_info()) == precompiled def test_dump_system_info_version(): + with mock.patch('subprocess.check_output') as m: + m.return_value = b"v2.0.0-0-cafecafe" + x = debug.dump_system_info() + assert 'dev' not in x + assert 'cafecafe' in x + with mock.patch('subprocess.check_output') as m: m.side_effect = subprocess.CalledProcessError(-1, 'git describe --tags --long') - assert 'release version' in debug.dump_system_info() + assert 'dev' not in debug.dump_system_info() def test_dump_info(): -- cgit v1.2.3