aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/test_certs.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/mitmproxy/test_certs.py b/test/mitmproxy/test_certs.py
index 12d3dc96..8421ec58 100644
--- a/test/mitmproxy/test_certs.py
+++ b/test/mitmproxy/test_certs.py
@@ -1,5 +1,6 @@
import os
from mitmproxy import certs
+from ..conftest import skip_windows
# class TestDNTree:
# def test_simple(self):
@@ -111,6 +112,14 @@ class TestCertStore:
certs.CertStore.load_dhparam(filename)
assert os.path.exists(filename)
+ @skip_windows
+ def test_umask_secret(self, tmpdir):
+ filename = str(tmpdir.join("secret"))
+ with certs.CertStore.umask_secret(), open(filename, "wb"):
+ pass
+ # TODO: How do we actually attempt to read that file as another user?
+ assert os.stat(filename).st_mode & 0o77 == 0
+
class TestDummyCert: