本文整理匯總了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!"