summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2019-05-19 20:44:14 -0400
committerPaul Kehrer <paul.l.kehrer@gmail.com>2019-05-19 20:44:14 -0400
commitaeca8a4364799492229c2ee6e1d12086a46fa7ce (patch)
treed562d68c03d0ad508738323edc7b56d6b27b73e2
parent1fbe064c50fd030948141d7d630673761525b0d0 (diff)
downloadpyopenssl-git-aeca8a4364799492229c2ee6e1d12086a46fa7ce.tar.gz
Remove tests of long functionality (#832)
These don't actually cover any code.
-rw-r--r--tests/test_ssl.py117
1 files changed, 0 insertions, 117 deletions
diff --git a/tests/test_ssl.py b/tests/test_ssl.py
index 362da5c..7916d43 100644
--- a/tests/test_ssl.py
+++ b/tests/test_ssl.py
@@ -530,13 +530,6 @@ class TestContext(object):
with pytest.raises(ValueError):
Context(10)
- @skip_if_py3
- def test_method_long(self):
- """
- On Python 2 `Context` accepts values of type `long` as well as `int`.
- """
- Context(long(TLSv1_METHOD))
-
def test_type(self):
"""
`Context` can be used to create instances of that type.
@@ -609,14 +602,6 @@ class TestContext(object):
FILETYPE_PEM,
)
- @skip_if_py3
- def test_use_privatekey_file_long(self, tmpfile):
- """
- On Python 2 `Context.use_privatekey_file` accepts a filetype of
- type `long` as well as `int`.
- """
- self._use_privatekey_file_test(tmpfile, long(FILETYPE_PEM))
-
def test_use_certificate_wrong_args(self):
"""
`Context.use_certificate_wrong_args` raises `TypeError` when not passed
@@ -705,19 +690,6 @@ class TestContext(object):
filename = tmpfile.decode(getfilesystemencoding()) + NON_ASCII
self._use_certificate_file_test(filename)
- @skip_if_py3
- def test_use_certificate_file_long(self, tmpfile):
- """
- On Python 2 `Context.use_certificate_file` accepts a
- filetype of type `long` as well as `int`.
- """
- pem_filename = tmpfile
- with open(pem_filename, "wb") as pem_file:
- pem_file.write(cleartextCertificatePEM)
-
- ctx = Context(TLSv1_METHOD)
- ctx.use_certificate_file(pem_filename, long(FILETYPE_PEM))
-
def test_check_privatekey_valid(self):
"""
`Context.check_privatekey` returns `None` if the `Context` instance
@@ -771,16 +743,6 @@ class TestContext(object):
options = context.set_options(OP_NO_SSLv2)
assert options & OP_NO_SSLv2 == OP_NO_SSLv2
- @skip_if_py3
- def test_set_options_long(self):
- """
- On Python 2 `Context.set_options` accepts values of type
- `long` as well as `int`.
- """
- context = Context(TLSv1_METHOD)
- options = context.set_options(long(OP_NO_SSLv2))
- assert options & OP_NO_SSLv2 == OP_NO_SSLv2
-
def test_set_mode_wrong_args(self):
"""
`Context.set_mode` raises `TypeError` if called with
@@ -798,16 +760,6 @@ class TestContext(object):
context = Context(TLSv1_METHOD)
assert MODE_RELEASE_BUFFERS & context.set_mode(MODE_RELEASE_BUFFERS)
- @skip_if_py3
- def test_set_mode_long(self):
- """
- On Python 2 `Context.set_mode` accepts values of type `long` as well
- as `int`.
- """
- context = Context(TLSv1_METHOD)
- mode = context.set_mode(long(MODE_RELEASE_BUFFERS))
- assert MODE_RELEASE_BUFFERS & mode
-
def test_set_timeout_wrong_args(self):
"""
`Context.set_timeout` raises `TypeError` if called with
@@ -827,16 +779,6 @@ class TestContext(object):
context.set_timeout(1234)
assert context.get_timeout() == 1234
- @skip_if_py3
- def test_timeout_long(self):
- """
- On Python 2 `Context.set_timeout` accepts values of type `long` as
- well as int.
- """
- context = Context(TLSv1_METHOD)
- context.set_timeout(long(1234))
- assert context.get_timeout() == 1234
-
def test_set_verify_depth_wrong_args(self):
"""
`Context.set_verify_depth` raises `TypeError` if called with a
@@ -856,16 +798,6 @@ class TestContext(object):
context.set_verify_depth(11)
assert context.get_verify_depth() == 11
- @skip_if_py3
- def test_verify_depth_long(self):
- """
- On Python 2 `Context.set_verify_depth` accepts values of type `long`
- as well as int.
- """
- context = Context(TLSv1_METHOD)
- context.set_verify_depth(long(11))
- assert context.get_verify_depth() == 11
-
def _write_encrypted_pem(self, passphrase, tmpfile):
"""
Write a new private key out to a new file, encrypted using the given
@@ -1486,19 +1418,6 @@ class TestContext(object):
VERIFY_PEER | VERIFY_CLIENT_ONCE, lambda *args: None)
assert context.get_verify_mode() == (VERIFY_PEER | VERIFY_CLIENT_ONCE)
- @skip_if_py3
- def test_set_verify_mode_long(self):
- """
- On Python 2 `Context.set_verify_mode` accepts values of type `long`
- as well as `int`.
- """
- context = Context(TLSv1_METHOD)
- assert context.get_verify_mode() == 0
- context.set_verify(
- long(VERIFY_PEER | VERIFY_CLIENT_ONCE), lambda *args: None
- ) # pragma: nocover
- assert context.get_verify_mode() == (VERIFY_PEER | VERIFY_CLIENT_ONCE)
-
@pytest.mark.parametrize('mode', [None, 1.0, object(), 'mode'])
def test_set_verify_wrong_mode_arg(self, mode):
"""
@@ -1604,16 +1523,6 @@ class TestContext(object):
assert SESS_CACHE_OFF == off
assert SESS_CACHE_BOTH == context.get_session_cache_mode()
- @skip_if_py3
- def test_session_cache_mode_long(self):
- """
- On Python 2 `Context.set_session_cache_mode` accepts values
- of type `long` as well as `int`.
- """
- context = Context(TLSv1_METHOD)
- context.set_session_cache_mode(long(SESS_CACHE_BOTH))
- assert SESS_CACHE_BOTH == context.get_session_cache_mode()
-
def test_get_cert_store(self):
"""
`Context.get_cert_store` returns a `X509Store` instance.
@@ -2401,16 +2310,6 @@ class TestConnection(object):
connection.set_shutdown(RECEIVED_SHUTDOWN)
assert connection.get_shutdown() == RECEIVED_SHUTDOWN
- @skip_if_py3
- def test_set_shutdown_long(self):
- """
- On Python 2 `Connection.set_shutdown` accepts an argument
- of type `long` as well as `int`.
- """
- connection = Connection(Context(TLSv1_METHOD), socket_any_family())
- connection.set_shutdown(long(RECEIVED_SHUTDOWN))
- assert connection.get_shutdown() == RECEIVED_SHUTDOWN
-
def test_state_string(self):
"""
`Connection.state_string` verbosely describes the current state of
@@ -2868,22 +2767,6 @@ class TestConnection(object):
data = conn.bio_read(2)
assert 2 == len(data)
- @skip_if_py3
- def test_buffer_size_long(self):
- """
- On Python 2 `Connection.bio_read` accepts values of type `long` as
- well as `int`.
- """
- ctx = Context(TLSv1_METHOD)
- conn = Connection(ctx, None)
- conn.set_connect_state()
- try:
- conn.do_handshake()
- except WantReadError:
- pass
- data = conn.bio_read(long(2))
- assert 2 == len(data)
-
class TestConnectionGetCipherList(object):
"""