Merge lp:~elopio/u1-test-utils/fix1197028-localmail_SMTPClient into lp:u1-test-utils

Proposed by Leo Arias
Status: Merged
Approved by: Leo Arias
Approved revision: 87
Merged at revision: 83
Proposed branch: lp:~elopio/u1-test-utils/fix1197028-localmail_SMTPClient
Merge into: lp:u1-test-utils
Diff against target: 73 lines (+17/-12)
3 files modified
fabfile/development.py (+4/-0)
requirements.txt (+1/-1)
u1testutils/selftests/unit/test_mail.py (+12/-11)
To merge this branch: bzr merge lp:~elopio/u1-test-utils/fix1197028-localmail_SMTPClient
Reviewer Review Type Date Requested Status
Corey Goldberg (community) Approve
Review via email: mp+172628@code.launchpad.net

Commit message

Updated localmail to version 36, and pinned it.

To post a comment you must log in.
Revision history for this message
Corey Goldberg (coreygoldberg) wrote :

lgtm.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'fabfile/development.py'
--- fabfile/development.py 2013-04-09 19:06:01 +0000
+++ fabfile/development.py 2013-07-02 16:56:07 +0000
@@ -15,6 +15,8 @@
15import os15import os
16import unittest16import unittest
1717
18from fabric import api
19
1820
19def test(suites=None):21def test(suites=None):
20 """Run tests.22 """Run tests.
@@ -46,6 +48,8 @@
46 res = runner.run(suite)48 res = runner.run(suite)
47 print 'Totals: ran({0}), skipped({1}), errors({2}), failures({3})'.format(49 print 'Totals: ran({0}), skipped({1}), errors({2}), failures({3})'.format(
48 res.testsRun, len(res.skipped), len(res.errors), len(res.failures))50 res.testsRun, len(res.skipped), len(res.errors), len(res.failures))
51 if not res.wasSuccessful():
52 api.abort('Tests failed.')
4953
5054
51def _load_static_tests(suite):55def _load_static_tests(suite):
5256
=== modified file 'requirements.txt'
--- requirements.txt 2013-05-02 20:55:10 +0000
+++ requirements.txt 2013-07-02 16:56:07 +0000
@@ -5,7 +5,7 @@
5pep85pep8
6pyflakes6pyflakes
7Twisted7Twisted
8bzr+ssh://bazaar.launchpad.net/~bloodearnest/localmail/trunk8bzr+ssh://bazaar.launchpad.net/~bloodearnest/localmail/trunk@36
9bzr+http://bazaar.launchpad.net/~ubuntuone-hackers/payclient/trunk@49bzr+http://bazaar.launchpad.net/~ubuntuone-hackers/payclient/trunk@4
10bzr+http://bazaar.launchpad.net/~canonical-isd-qa/selenium-simple-test/trunk@37710bzr+http://bazaar.launchpad.net/~canonical-isd-qa/selenium-simple-test/trunk@377
11bzr+http://bazaar.launchpad.net/~canonical-isd-hackers/canonical-identity-provider/ssoclient@311bzr+http://bazaar.launchpad.net/~canonical-isd-hackers/canonical-identity-provider/ssoclient@3
1212
=== modified file 'u1testutils/selftests/unit/test_mail.py'
--- u1testutils/selftests/unit/test_mail.py 2013-05-22 13:13:01 +0000
+++ u1testutils/selftests/unit/test_mail.py 2013-07-02 16:56:07 +0000
@@ -18,6 +18,7 @@
18import threading18import threading
19import time19import time
20import unittest20import unittest
21from email.mime import text as mime_text
2122
22import localmail23import localmail
23import localmail.tests.helpers24import localmail.tests.helpers
@@ -56,15 +57,15 @@
56 localmail.shutdown_thread(class_.localmail_thread)57 localmail.shutdown_thread(class_.localmail_thread)
5758
58 def test_get_latest_email(self):59 def test_get_latest_email(self):
59 from_ = 'from@example.com'60 message = mime_text.MIMEText('Test body')
60 to = 'to@example.com'61 message['Subject'] = 'Test Subject'
61 subject = 'Test Subject'62 message['From'] = 'from@example.com'
62 body = 'Test body'63 message['To'] = 'to@example.com'
63 with localmail.tests.helpers.SMTPHelper(port=self.SMTP_PORT) as smtp:64 with localmail.tests.helpers.SMTPClient(port=self.SMTP_PORT) as smtp:
64 smtp.login()65 smtp.send(message)
65 smtp.send(from_, to, subject, body)
66 latest_email = mail.get_latest_email_sent_to('to@example.com')66 latest_email = mail.get_latest_email_sent_to('to@example.com')
67 self.assertEquals(latest_email['From'], from_)67 self.assertEquals(latest_email['From'], message['From'])
68 self.assertEquals(latest_email['To'], to)68 self.assertEquals(latest_email['To'], message['To'])
69 self.assertEquals(latest_email['Subject'], subject)69 self.assertEquals(latest_email['Subject'], message['Subject'])
70 self.assertEquals(latest_email.get_payload(), body + '\n')70 self.assertEquals(
71 latest_email.get_payload(), message.get_payload() + '\n')

Subscribers

People subscribed via source and target branches

to all changes: