本文整理汇总了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