Rev 35: Fixed as per Robert's review. in http://bazaar.launchpad.net/%7Evila/bzr/bzr-email
Vincent Ladeuil
v.ladeuil+lp at free.fr
Wed May 21 09:39:47 BST 2008
At http://bazaar.launchpad.net/%7Evila/bzr/bzr-email
------------------------------------------------------------
revno: 35
revision-id: v.ladeuil+lp at free.fr-20080521083945-4mvpgin6wkfmwsxq
parent: v.ladeuil+lp at free.fr-20080521072748-y7jeky3yw8kbf7ko
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: email
timestamp: Wed 2008-05-21 10:39:45 +0200
message:
Fixed as per Robert's review.
* tests/testemail.py:
(TestGetTo.test_should_send): Revert previous changes.
* emailer.py:
(EmailSender.should_send): Return a boolean.
modified:
emailer.py emailer.py-20070123220937-ec5y2n2oeoa0p4ue-1
tests/testemail.py testpublish.py-20051018071212-e3a53d78c05e0e0a
-------------- next part --------------
=== modified file 'emailer.py'
--- a/emailer.py 2007-09-19 21:38:05 +0000
+++ b/emailer.py 2008-05-21 08:39:45 +0000
@@ -222,7 +222,7 @@
self.diff_filename())
def should_send(self):
- return self.to() and self.from_address()
+ return bool(self.to() and self.from_address())
def send_maybe(self):
if self.should_send():
=== modified file 'tests/testemail.py'
--- a/tests/testemail.py 2008-05-21 07:27:48 +0000
+++ b/tests/testemail.py 2008-05-21 08:39:45 +0000
@@ -94,19 +94,19 @@
def test_should_send(self):
sender = self.get_sender()
- self.assertTrue(sender.should_send())
+ self.assertEqual(True, sender.should_send())
def test_should_not_send(self):
sender = self.get_sender(unconfigured_config)
- self.assertFalse(sender.should_send())
+ self.assertEqual(False, sender.should_send())
def test_should_not_send_sender_configured(self):
sender = self.get_sender(sender_configured_config)
- self.assertFalse(sender.should_send())
+ self.assertEqual(False, sender.should_send())
def test_should_not_send_to_configured(self):
sender = self.get_sender(to_configured_config)
- self.assertTrue(sender.should_send())
+ self.assertEqual(True, sender.should_send())
def test_send_to_multiple(self):
sender = self.get_sender(multiple_to_configured_config)
More information about the bazaar-commits
mailing list