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