diff options
author | Maximilian Hils <git@maximilianhils.com> | 2017-10-23 18:24:06 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2017-10-24 14:33:56 +0200 |
commit | a5d74356dda2f34d9bebf3a3276f5f7d1869985a (patch) | |
tree | 63cd310cea348e06647ffe196dd1182ba2ed75bd /test | |
parent | 569d275d763f499cce9673fcf118dcc8d59d2eeb (diff) | |
download | mitmproxy-a5d74356dda2f34d9bebf3a3276f5f7d1869985a.tar.gz mitmproxy-a5d74356dda2f34d9bebf3a3276f5f7d1869985a.tar.bz2 mitmproxy-a5d74356dda2f34d9bebf3a3276f5f7d1869985a.zip |
simplify version output
Diffstat (limited to 'test')
-rw-r--r-- | test/mitmproxy/utils/test_debug.py | 10 |
1 files changed, 8 insertions, 2 deletions
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(): |