本文整理匯總了Python中inbox.auth.generic.GenericAuthHandler.connect_account方法的典型用法代碼示例。如果您正苦於以下問題:Python GenericAuthHandler.connect_account方法的具體用法?Python GenericAuthHandler.connect_account怎麽用?Python GenericAuthHandler.connect_account使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類inbox.auth.generic.GenericAuthHandler
的用法示例。
在下文中一共展示了GenericAuthHandler.connect_account方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_imap_not_fully_enabled
# 需要導入模塊: from inbox.auth.generic import GenericAuthHandler [as 別名]
# 或者: from inbox.auth.generic.GenericAuthHandler import connect_account [as 別名]
def test_imap_not_fully_enabled(monkeypatch):
def folder_list_fail(conn):
raise Exception("LIST failed: '[ALERT] full IMAP support "
"is NOT enabled for this account'")
monkeypatch.setattr('imapclient.IMAPClient.list_folders',
folder_list_fail)
def fake_connect(account):
return MockIMAPClient()
response = {
'email': '[email protected]',
'password': 'test123',
'imap_server_host': '0.0.0.0',
'imap_server_port': 22,
'smtp_server_host': '0.0.0.0',
'smtp_server_port': 23
}
handler = GenericAuthHandler('custom')
acct = handler.create_account(
'[email protected]',
response)
handler.connect_account = fake_connect
handler._supports_condstore = lambda x: True
with pytest.raises(UserRecoverableConfigError):
verified = handler.verify_account(acct)
assert verified is not True