Changeset View
Changeset View
Standalone View
Standalone View
tests/functional/test_wallace/test_002_footer.py
Show All 11 Lines | |||||
import pykolab | import pykolab | ||||
from pykolab import wap_client | from pykolab import wap_client | ||||
from pykolab.auth import Auth | from pykolab.auth import Auth | ||||
from pykolab.imap import IMAP | from pykolab.imap import IMAP | ||||
conf = pykolab.getConf() | conf = pykolab.getConf() | ||||
class TestWallaceFooter(unittest.TestCase): | class TestWallaceFooter(unittest.TestCase): | ||||
user = None | user = None | ||||
@classmethod | @classmethod | ||||
def setUp(self): | def setUp(self): | ||||
""" Compatibility for twisted.trial.unittest | """ Compatibility for twisted.trial.unittest | ||||
""" | """ | ||||
if not self.user: | if not self.user: | ||||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | def message_standard_params(self, subject, msg): | ||||
msg['Subject'] = subject | msg['Subject'] = subject | ||||
msg['Date'] = formatdate(localtime=True) | msg['Date'] = formatdate(localtime=True) | ||||
return msg | return msg | ||||
def send_message(self, msg, _to=None, _from=None): | def send_message(self, msg, _to=None, _from=None): | ||||
smtp = smtplib.SMTP('localhost', 10026) | smtp = smtplib.SMTP('localhost', 10026) | ||||
if _to == None: | if _to is None: | ||||
_to = self.send_to | _to = self.send_to | ||||
if _from == None: | if _from is None: | ||||
_from = self.send_from | _from = self.send_from | ||||
smtp.sendmail(_from, _to, msg.as_string()) | smtp.sendmail(_from, _to, msg.as_string()) | ||||
def test_001_inbox_created(self): | def test_001_inbox_created(self): | ||||
imap = IMAP() | imap = IMAP() | ||||
imap.connect() | imap.connect() | ||||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |