summaryrefslogtreecommitdiff
path: root/OpenSSL
diff options
context:
space:
mode:
authorHynek Schlawack <hs@ox.cx>2015-09-05 21:39:50 +0200
committerHynek Schlawack <hs@ox.cx>2015-09-05 21:39:50 +0200
commite2f8a098e62d518bb3effcb1f261f7dffcbdc153 (patch)
tree0040b165101d8421e4d2950895a423b4e847d893 /OpenSSL
parent8a217590682985ab485b95259d7fc54ca12bb6e9 (diff)
downloadpyopenssl-e2f8a098e62d518bb3effcb1f261f7dffcbdc153.tar.gz
wip
Diffstat (limited to 'OpenSSL')
-rw-r--r--OpenSSL/test/test_ssl.py52
1 files changed, 20 insertions, 32 deletions
diff --git a/OpenSSL/test/test_ssl.py b/OpenSSL/test/test_ssl.py
index b4c42af..f35a36e 100644
--- a/OpenSSL/test/test_ssl.py
+++ b/OpenSSL/test/test_ssl.py
@@ -3003,17 +3003,15 @@ class ConnectionSendallTests(TestCase, _LoopbackMixin):
self.assertRaises(
TypeError, connection.sendall, "foo", object(), "bar")
-
def test_short(self):
"""
- :py:obj:`Connection.sendall` transmits all of the bytes in the string passed to
- it.
+ :py:obj:`Connection.sendall` transmits all of the bytes in the string
+ passed to it.
"""
server, client = self._loopback()
server.sendall(b('x'))
self.assertEquals(client.recv(1), b('x'))
-
def test_text(self):
"""
:py:obj:`Connection.sendall` transmits all the content in the string
@@ -3032,35 +3030,25 @@ class ConnectionSendallTests(TestCase, _LoopbackMixin):
self.assertIs(w[-1].category, DeprecationWarning)
self.assertEquals(client.recv(1), b"x")
+ @skip_if_py26
+ def test_short_memoryview(self):
+ """
+ When passed a memoryview onto a small number of bytes,
+ :py:obj:`Connection.sendall` transmits all of them.
+ """
+ server, client = self._loopback()
+ server.sendall(memoryview(b('x')))
+ self.assertEquals(client.recv(1), b('x'))
- try:
- memoryview
- except NameError:
- "cannot test sending memoryview without memoryview"
- else:
- def test_short_memoryview(self):
- """
- When passed a memoryview onto a small number of bytes,
- :py:obj:`Connection.sendall` transmits all of them.
- """
- server, client = self._loopback()
- server.sendall(memoryview(b('x')))
- self.assertEquals(client.recv(1), b('x'))
-
-
- try:
- buffer
- except NameError:
- "cannot test sending buffers without buffers"
- else:
- def test_short_buffers(self):
- """
- When passed a buffer containing a small number of bytes,
- :py:obj:`Connection.sendall` transmits all of them.
- """
- server, client = self._loopback()
- server.sendall(buffer(b('x')))
- self.assertEquals(client.recv(1), b('x'))
+ @skip_if_py3
+ def test_short_buffers(self):
+ """
+ When passed a buffer containing a small number of bytes,
+ :py:obj:`Connection.sendall` transmits all of them.
+ """
+ server, client = self._loopback()
+ server.sendall(buffer(b('x')))
+ self.assertEquals(client.recv(1), b('x'))
def test_long(self):