summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ssl.py
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-04-03 02:12:54 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-04-03 02:12:54 (GMT)
commit519f91215bd353c745946e5d892fd1f089dbcb84 (patch)
tree09bae2446a79d3d69a9a4ff72e1ec3084766f61e /Lib/test/test_ssl.py
parent50badad807abc5367359bd81a2a8051ff5cdce7e (diff)
downloadcpython-519f91215bd353c745946e5d892fd1f089dbcb84.zip
cpython-519f91215bd353c745946e5d892fd1f089dbcb84.tar.gz
cpython-519f91215bd353c745946e5d892fd1f089dbcb84.tar.bz2
Issue #25951: Fix SSLSocket.sendall() to return None, by Aviv Palivoda
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r--Lib/test/test_ssl.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index e0f231c..00d437a 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -2709,12 +2709,13 @@ if _have_threads:
count, addr = s.recvfrom_into(b)
return b[:count]
- # (name, method, whether to expect success, *args)
+ # (name, method, expect success?, *args, return value func)
send_methods = [
- ('send', s.send, True, []),
- ('sendto', s.sendto, False, ["some.address"]),
- ('sendall', s.sendall, True, []),
+ ('send', s.send, True, [], len),
+ ('sendto', s.sendto, False, ["some.address"], len),
+ ('sendall', s.sendall, True, [], lambda x: None),
]
+ # (name, method, whether to expect success, *args)
recv_methods = [
('recv', s.recv, True, []),
('recvfrom', s.recvfrom, False, ["some.address"]),
@@ -2723,10 +2724,13 @@ if _have_threads:
]
data_prefix = "PREFIX_"
- for meth_name, send_meth, expect_success, args in send_methods:
+ for (meth_name, send_meth, expect_success, args,
+ ret_val_meth) in send_methods:
indata = (data_prefix + meth_name).encode('ascii')
try:
- send_meth(indata, *args)
+ ret = send_meth(indata, *args)
+ msg = "sending with {}".format(meth_name)
+ self.assertEqual(ret, ret_val_meth(indata), msg=msg)
outdata = s.read()
if outdata != indata.lower():
self.fail(