summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2020-08-26 22:50:40 -0400
committerGitHub <noreply@github.com>2020-08-26 21:50:40 -0500
commit048821406137d6aba237c6309009dbe744548208 (patch)
treef38d7d3dacfde9a4ee92dc6754a1bf57941beca8
parentffab488a52ff60f19d93880e9378f1ebbfda5c85 (diff)
downloadpyopenssl-git-048821406137d6aba237c6309009dbe744548208.tar.gz
I'm back in black (#941)
-rw-r--r--src/OpenSSL/SSL.py9
-rw-r--r--tests/test_ssl.py21
2 files changed, 21 insertions, 9 deletions
diff --git a/src/OpenSSL/SSL.py b/src/OpenSSL/SSL.py
index d889624..bbb721c 100644
--- a/src/OpenSSL/SSL.py
+++ b/src/OpenSSL/SSL.py
@@ -972,7 +972,11 @@ class Context(object):
"""
buf = _text_to_bytes_and_warn("buf", buf)
_openssl_assert(
- _lib.SSL_CTX_set_session_id_context(self._context, buf, len(buf),)
+ _lib.SSL_CTX_set_session_id_context(
+ self._context,
+ buf,
+ len(buf),
+ )
== 1
)
@@ -1468,9 +1472,6 @@ class Context(object):
class Connection(object):
- """
- """
-
_reverse_mapping = WeakValueDictionary()
def __init__(self, context, socket=None):
diff --git a/tests/test_ssl.py b/tests/test_ssl.py
index 0860eb8..e405b1a 100644
--- a/tests/test_ssl.py
+++ b/tests/test_ssl.py
@@ -448,7 +448,8 @@ def ca_file(tmpdir):
builder = builder.serial_number(int(uuid.uuid4()))
builder = builder.public_key(public_key)
builder = builder.add_extension(
- x509.BasicConstraints(ca=True, path_length=None), critical=True,
+ x509.BasicConstraints(ca=True, path_length=None),
+ critical=True,
)
certificate = builder.sign(
@@ -457,7 +458,9 @@ def ca_file(tmpdir):
ca_file = tmpdir.join("test.pem")
ca_file.write_binary(
- certificate.public_bytes(encoding=serialization.Encoding.PEM,)
+ certificate.public_bytes(
+ encoding=serialization.Encoding.PEM,
+ )
)
return str(ca_file).encode("ascii")
@@ -509,7 +512,13 @@ class TestContext(object):
with pytest.raises(Error) as excinfo:
context.set_cipher_list(b"imaginary-cipher")
assert excinfo.value.args == (
- [("SSL routines", "SSL_CTX_set_cipher_list", "no cipher match",)],
+ [
+ (
+ "SSL routines",
+ "SSL_CTX_set_cipher_list",
+ "no cipher match",
+ )
+ ],
)
def test_load_client_ca(self, context, ca_file):
@@ -644,7 +653,8 @@ class TestContext(object):
instance giving the file name to ``Context.use_privatekey_file``.
"""
self._use_privatekey_file_test(
- tmpfile + NON_ASCII.encode(getfilesystemencoding()), FILETYPE_PEM,
+ tmpfile + NON_ASCII.encode(getfilesystemencoding()),
+ FILETYPE_PEM,
)
def test_use_privatekey_file_unicode(self, tmpfile):
@@ -653,7 +663,8 @@ class TestContext(object):
instance giving the file name to ``Context.use_privatekey_file``.
"""
self._use_privatekey_file_test(
- tmpfile.decode(getfilesystemencoding()) + NON_ASCII, FILETYPE_PEM,
+ tmpfile.decode(getfilesystemencoding()) + NON_ASCII,
+ FILETYPE_PEM,
)
def test_use_certificate_wrong_args(self):