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__))
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")
def do_imap_login(self): """Login to the imap.""" self.imap = imaputils.login_imap(self.imapsets, logger=self.logger, assertok=self.assertok)