本文整理汇总了Python中paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED属性的典型用法代码示例。如果您正苦于以下问题:Python paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED属性的具体用法?Python paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED怎么用?Python paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类paramiko
的用法示例。
在下文中一共展示了paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_channel_request
# 需要导入模块: import paramiko [as 别名]
# 或者: from paramiko import OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED [as 别名]
def check_channel_request(self, kind, chanid):
if kind == 'bogus':
return OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
return OPEN_SUCCEEDED
示例2: test_8_channel_exception
# 需要导入模块: import paramiko [as 别名]
# 或者: from paramiko import OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED [as 别名]
def test_8_channel_exception(self):
"""
verify that ChannelException is thrown for a bad open-channel request.
"""
self.setup_test_server()
try:
chan = self.tc.open_channel('bogus')
self.fail('expected exception')
except ChannelException as e:
self.assertTrue(e.code == OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED)
示例3: test_server_rejects_open_channel_without_auth
# 需要导入模块: import paramiko [as 别名]
# 或者: from paramiko import OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED [as 别名]
def test_server_rejects_open_channel_without_auth(self):
try:
self.setup_test_server(connect_kwargs={})
self.tc.open_session()
except ChannelException as e:
assert e.code == OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED
else:
assert False, "Did not raise ChannelException!"