diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-05-28 12:12:37 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-05-28 12:12:37 +1200 |
commit | 41af65a1c478825d4df6239b33fbcb971dcf1df8 (patch) | |
tree | 9830657189938900adad330beba0478f0d0761c2 /test/test_certutils.py | |
parent | 5265b289575d3935e8af29b5c27c963832efc8ad (diff) | |
parent | 80378306960379f12aca72309dc47437cd1a825c (diff) | |
download | mitmproxy-41af65a1c478825d4df6239b33fbcb971dcf1df8.tar.gz mitmproxy-41af65a1c478825d4df6239b33fbcb971dcf1df8.tar.bz2 mitmproxy-41af65a1c478825d4df6239b33fbcb971dcf1df8.zip |
Merge branch 'Kriechi-cleanup'
Diffstat (limited to 'test/test_certutils.py')
-rw-r--r-- | test/test_certutils.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/test_certutils.py b/test/test_certutils.py index c96c5087..115cac4d 100644 --- a/test/test_certutils.py +++ b/test/test_certutils.py @@ -1,6 +1,5 @@ import os from netlib import certutils, certffi -import OpenSSL import tutils # class TestDNTree: @@ -34,6 +33,7 @@ import tutils class TestCertStore: + def test_create_explicit(self): with tutils.tmpdir() as d: ca = certutils.CertStore.from_store(d, "test") @@ -56,13 +56,13 @@ class TestCertStore: def test_add_cert(self): with tutils.tmpdir() as d: - ca = certutils.CertStore.from_store(d, "test") + certutils.CertStore.from_store(d, "test") def test_sans(self): with tutils.tmpdir() as d: ca = certutils.CertStore.from_store(d, "test") c1 = ca.get_cert("foo.com", ["*.bar.com"]) - c2 = ca.get_cert("foo.bar.com", []) + ca.get_cert("foo.bar.com", []) # assert c1 == c2 c3 = ca.get_cert("bar.com", []) assert not c1 == c3 @@ -70,7 +70,7 @@ class TestCertStore: def test_sans_change(self): with tutils.tmpdir() as d: ca = certutils.CertStore.from_store(d, "test") - _ = ca.get_cert("foo.com", ["*.bar.com"]) + ca.get_cert("foo.com", ["*.bar.com"]) cert, key, chain_file = ca.get_cert("foo.bar.com", ["*.baz.com"]) assert "*.baz.com" in cert.altnames @@ -102,6 +102,7 @@ class TestCertStore: class TestDummyCert: + def test_with_ca(self): with tutils.tmpdir() as d: ca = certutils.CertStore.from_store(d, "test") @@ -115,6 +116,7 @@ class TestDummyCert: class TestSSLCert: + def test_simple(self): with open(tutils.test_data.path("data/text_cert"), "rb") as f: d = f.read() @@ -152,5 +154,3 @@ class TestSSLCert: d = f.read() s = certutils.SSLCert.from_der(d) assert s.cn - - |