Esempio n. 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__))
Esempio n. 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")
Esempio n. 3
0
 def do_imap_login(self):
     """Login to the imap."""
     self.imap = imaputils.login_imap(self.imapsets,
                                      logger=self.logger,
                                      assertok=self.assertok)
Esempio n. 4
0
File: isbg.py Progetto: leorbs/isbg
 def do_imap_login(self):
     """Login to the imap."""
     self.imap = imaputils.login_imap(self.imapsets,
                                      logger=self.logger,
                                      assertok=self.assertok)