diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2014-11-01 08:45:57 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2014-11-01 08:45:57 (GMT) |
commit | 8f791d358bb1e26144c61a938628731e7e05e596 (patch) | |
tree | 34dbf14a0395cec72b5146da4327795a49fd9144 /Lib/test/test_ftplib.py | |
parent | 8906f14a68d6ce19923e29d9e433f44d440324b4 (diff) | |
download | cpython-8f791d358bb1e26144c61a938628731e7e05e596.zip cpython-8f791d358bb1e26144c61a938628731e7e05e596.tar.gz cpython-8f791d358bb1e26144c61a938628731e7e05e596.tar.bz2 |
Issue #6623: Remove deprecated Netrc class in the ftplib module.
Patch by Matt Chaput.
Diffstat (limited to 'Lib/test/test_ftplib.py')
-rw-r--r-- | Lib/test/test_ftplib.py | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index e043828..b401cf7 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -76,7 +76,7 @@ class DummyDTPHandler(asynchat.async_chat): super(DummyDTPHandler, self).push(what.encode('ascii')) def handle_error(self): - raise + raise Exception class DummyFTPHandler(asynchat.async_chat): @@ -121,7 +121,7 @@ class DummyFTPHandler(asynchat.async_chat): self.push('550 command "%s" not understood.' %cmd) def handle_error(self): - raise + raise Exception def push(self, data): asynchat.async_chat.push(self, data.encode('ascii') + b'\r\n') @@ -299,7 +299,7 @@ class DummyFTPServer(asyncore.dispatcher, threading.Thread): return 0 def handle_error(self): - raise + raise Exception if ssl is not None: @@ -397,7 +397,7 @@ if ssl is not None: raise def handle_error(self): - raise + raise Exception def close(self): if (isinstance(self.socket, ssl.SSLSocket) and @@ -673,7 +673,7 @@ class TestFTPClass(TestCase): self.assertRaises(StopIteration, next, self.client.mlsd()) set_data('') for x in self.client.mlsd(): - self.fail("unexpected data %s" % data) + self.fail("unexpected data %s" % x) def test_makeport(self): with self.client.makeport(): @@ -1053,19 +1053,8 @@ class TestTimeouts(TestCase): ftp.close() -class TestNetrcDeprecation(TestCase): - - def test_deprecation(self): - with support.temp_cwd(), support.EnvironmentVarGuard() as env: - env['HOME'] = os.getcwd() - open('.netrc', 'w').close() - with self.assertWarns(DeprecationWarning): - ftplib.Netrc() - - - def test_main(): - tests = [TestFTPClass, TestTimeouts, TestNetrcDeprecation, + tests = [TestFTPClass, TestTimeouts, TestIPv6Environment, TestTLS_FTPClassMixin, TestTLS_FTPClass] |