aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Kriechbaumer <thomas@kriechbaumer.name>2017-02-20 10:21:28 +0100
committerThomas Kriechbaumer <thomas@kriechbaumer.name>2017-02-20 11:11:10 +0100
commitac6915c002624d233ec14ed5f151a3a516697d7c (patch)
treed867dde7888ef8e46c75dfd69dfa67b5055e3a3a
parent51e08a5b85aa1428a1de0c0b72df6ae90ff890ad (diff)
downloadmitmproxy-ac6915c002624d233ec14ed5f151a3a516697d7c.tar.gz
mitmproxy-ac6915c002624d233ec14ed5f151a3a516697d7c.tar.bz2
mitmproxy-ac6915c002624d233ec14ed5f151a3a516697d7c.zip
improve tests
-rw-r--r--test/mitmproxy/utils/test_debug.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/mitmproxy/utils/test_debug.py b/test/mitmproxy/utils/test_debug.py
index b6d6407c..4371ef70 100644
--- a/test/mitmproxy/utils/test_debug.py
+++ b/test/mitmproxy/utils/test_debug.py
@@ -2,14 +2,19 @@ import io
import subprocess
import sys
from unittest import mock
+import pytest
from mitmproxy.utils import debug
-def test_dump_system_info():
- setattr(sys, 'frozen', True)
- assert debug.dump_system_info()
+@pytest.mark.parametrize("precompiled", [True, False])
+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
+
+def test_dump_system_info_version():
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()