本文整理匯總了Python中ftplib.error_reply方法的典型用法代碼示例。如果您正苦於以下問題:Python ftplib.error_reply方法的具體用法?Python ftplib.error_reply怎麽用?Python ftplib.error_reply使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ftplib
的用法示例。
在下文中一共展示了ftplib.error_reply方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_all_errors
# 需要導入模塊: import ftplib [as 別名]
# 或者: from ftplib import error_reply [as 別名]
def test_all_errors(self):
exceptions = (ftplib.error_reply, ftplib.error_temp, ftplib.error_perm,
ftplib.error_proto, ftplib.Error, IOError, EOFError)
for x in exceptions:
try:
raise x('exception not included in all_errors set')
except ftplib.all_errors:
pass
示例2: test_voidcmd
# 需要導入模塊: import ftplib [as 別名]
# 或者: from ftplib import error_reply [as 別名]
def test_voidcmd(self):
self.client.voidcmd('echo 200')
self.client.voidcmd('echo 299')
self.assertRaises(ftplib.error_reply, self.client.voidcmd, 'echo 199')
self.assertRaises(ftplib.error_reply, self.client.voidcmd, 'echo 300')
示例3: test_rename
# 需要導入模塊: import ftplib [as 別名]
# 或者: from ftplib import error_reply [as 別名]
def test_rename(self):
self.client.rename('a', 'b')
self.server.handler_instance.next_response = '200'
self.assertRaises(ftplib.error_reply, self.client.rename, 'a', 'b')
示例4: test_delete
# 需要導入模塊: import ftplib [as 別名]
# 或者: from ftplib import error_reply [as 別名]
def test_delete(self):
self.client.delete('foo')
self.server.handler_instance.next_response = '199'
self.assertRaises(ftplib.error_reply, self.client.delete, 'foo')
示例5: test_rename
# 需要導入模塊: import ftplib [as 別名]
# 或者: from ftplib import error_reply [as 別名]
def test_rename(self):
self.client.rename('a', 'b')
self.server.handler.next_response = '200'
self.assertRaises(ftplib.error_reply, self.client.rename, 'a', 'b')
示例6: test_delete
# 需要導入模塊: import ftplib [as 別名]
# 或者: from ftplib import error_reply [as 別名]
def test_delete(self):
self.client.delete('foo')
self.server.handler.next_response = '199'
self.assertRaises(ftplib.error_reply, self.client.delete, 'foo')
示例7: test_all_errors
# 需要導入模塊: import ftplib [as 別名]
# 或者: from ftplib import error_reply [as 別名]
def test_all_errors(self):
exceptions = (ftplib.error_reply, ftplib.error_temp, ftplib.error_perm,
ftplib.error_proto, ftplib.Error, OSError, EOFError)
for x in exceptions:
try:
raise x('exception not included in all_errors set')
except ftplib.all_errors:
pass
示例8: test_parse257
# 需要導入模塊: import ftplib [as 別名]
# 或者: from ftplib import error_reply [as 別名]
def test_parse257(self):
self.assertEqual(ftplib.parse257('257 "/foo/bar"'), '/foo/bar')
self.assertEqual(ftplib.parse257('257 "/foo/bar" created'), '/foo/bar')
self.assertEqual(ftplib.parse257('257 ""'), '')
self.assertEqual(ftplib.parse257('257 "" created'), '')
self.assertRaises(ftplib.error_reply, ftplib.parse257, '250 "/foo/bar"')
# The 257 response is supposed to include the directory
# name and in case it contains embedded double-quotes
# they must be doubled (see RFC-959, chapter 7, appendix 2).
self.assertEqual(ftplib.parse257('257 "/foo/b""ar"'), '/foo/b"ar')
self.assertEqual(ftplib.parse257('257 "/foo/b""ar" created'), '/foo/b"ar')
示例9: test_all_errors
# 需要導入模塊: import ftplib [as 別名]
# 或者: from ftplib import error_reply [as 別名]
def test_all_errors(self):
exceptions = (ftplib.error_reply, ftplib.error_temp, ftplib.error_perm,
ftplib.error_proto, ftplib.Error, OSError,
EOFError)
for x in exceptions:
try:
raise x('exception not included in all_errors set')
except ftplib.all_errors:
pass