示例#1
0
def test_login_imap():
    """Test login_imap."""
    with pytest.raises(TypeError, match="ImapSettings",
                       message="spected a ImapSettings"):
        imaputils.login_imap(None)

    imapsets = imaputils.ImapSettings()
    imapsets.host = ''  # don't try to connect to internet
    imapsets.nossl = True
    with pytest.raises(Exception, match="[Errno -5]",
                       message="No address associated with hostname"):
        imaputils.login_imap(imapsets, logger=logging.getLogger(__name__))
示例#2
0
def test_login_imap():
    """Test login_imap."""
    with pytest.raises(TypeError, match="ImapSettings"):
        imaputils.login_imap(None)
        pytest.fail("spected a ImapSettings")

    imapsets = imaputils.ImapSettings()
    imapsets.host = ''  # don't try to connect to internet
    imapsets.nossl = True
    with pytest.raises(Exception, match="[Errno -5]"):
        imaputils.login_imap(imapsets, logger=logging.getLogger(__name__))
        pytest.fail("No address associated with hostname")
示例#3
0
文件: isbg.py 项目: baldurmen/isbg
 def do_imap_login(self):
     """Login to the imap."""
     self.imap = imaputils.login_imap(self.imapsets,
                                      logger=self.logger,
                                      assertok=self.assertok)
示例#4
0
文件: isbg.py 项目: leorbs/isbg
 def do_imap_login(self):
     """Login to the imap."""
     self.imap = imaputils.login_imap(self.imapsets,
                                      logger=self.logger,
                                      assertok=self.assertok)