diff options
author | Maximilian Hils <git@maximilianhils.com> | 2017-10-24 15:21:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-24 15:21:37 +0200 |
commit | 45145ed08b7623add9a96bfcdcd02a746e44124a (patch) | |
tree | 2df3d67861a75d798b9e6ad4154d43ea96d0b387 /test | |
parent | 964eadeacf41864223eb1e13e44f61fc1df40d48 (diff) | |
parent | a5d74356dda2f34d9bebf3a3276f5f7d1869985a (diff) | |
download | mitmproxy-45145ed08b7623add9a96bfcdcd02a746e44124a.tar.gz mitmproxy-45145ed08b7623add9a96bfcdcd02a746e44124a.tar.bz2 mitmproxy-45145ed08b7623add9a96bfcdcd02a746e44124a.zip |
Merge pull request #2602 from mhils/simplify-version
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(): |