Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7)

Unified Diff: Lib/test/test_ftplib.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_fcntl.py ('k') | Lib/test/test_future5.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_ftplib.py Tue Jul 26 09:37:46 2011 +0300
+++ b/Lib/test/test_ftplib.py Mon Jul 25 09:47:18 2011 -0400
@@ -303,11 +303,11 @@
_ssl_closing = False
def secure_connection(self):
+ self.del_channel()
socket = ssl.wrap_socket(self.socket, suppress_ragged_eofs=False,
certfile=CERTFILE, server_side=True,
do_handshake_on_connect=False,
ssl_version=ssl.PROTOCOL_SSLv23)
- self.del_channel()
self.set_socket(socket)
self._ssl_accepting = True
@@ -342,10 +342,7 @@
# http://www.mail-archive.com/openssl-users@openssl.org/msg60710.html
pass
self._ssl_closing = False
- if getattr(self, '_ccc', False) == False:
- super(SSLConnection, self).close()
- else:
- pass
+ super(SSLConnection, self).close()
def handle_read_event(self):
if self._ssl_accepting:
@@ -413,18 +410,12 @@
def __init__(self, conn):
DummyFTPHandler.__init__(self, conn)
self.secure_data_channel = False
- self._ccc = False
def cmd_auth(self, line):
"""Set up secure control channel."""
self.push('234 AUTH TLS successful')
self.secure_connection()
- def cmd_ccc(self, line):
- self.push('220 Reverting back to clear-text')
- self._ccc = True
- self._do_ssl_shutdown()
-
def cmd_pbsz(self, line):
"""Negotiate size of buffer for secure data transfer.
For TLS/SSL the only valid value for the parameter is '0'.
@@ -881,13 +872,6 @@
self.assertIs(sock.context, ctx)
self.assertIsInstance(sock, ssl.SSLSocket)
- def test_ccc(self):
- self.assertRaises(ValueError, self.client.ccc)
- self.client.login(secure=True)
- self.assertIsInstance(self.client.sock, ssl.SSLSocket)
- self.client.ccc()
- self.assertRaises(ValueError, self.client.sock.unwrap)
-
class TestTimeouts(TestCase):
« no previous file with comments | « Lib/test/test_fcntl.py ('k') | Lib/test/test_future5.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+