[Zope3-checkins] CVS: Products3/z3checkins/tests - test_message.py:1.19

Gintautas Miliauskas gintas at pov.lt
Tue Feb 10 12:51:15 EST 2004


Update of /cvs-repository/Products3/z3checkins/tests
In directory cvs.zope.org:/tmp/cvs-serv3262/tests

Modified Files:
	test_message.py 
Log Message:
* Removed obsolete 'author' attribute from messages.
* Subject and creation date is now stored in Dublin Core as well.
* Modified message.py to barf on invalid messages.


=== Products3/z3checkins/tests/test_message.py 1.18 => 1.19 ===
--- Products3/z3checkins/tests/test_message.py:1.18	Tue Feb 10 11:20:29 2004
+++ Products3/z3checkins/tests/test_message.py	Tue Feb 10 12:51:14 2004
@@ -121,7 +121,6 @@
         msg = parser.parse(sample_msg1)
         self.assert_(ICheckinMessage.isImplementedBy(msg))
         self.assertEquals(msg.message_id, "42 at bar.com")
-        self.assertEquals(msg.author, "Foo Bar <foo.bar at bar.com>")
         self.assertEquals(msg.author_name, "Foo Bar")
         self.assertEquals(msg.author_email, "foo.bar at bar.com")
         self.assertEquals(msg.date, datetime(2003, 03, 28, 11, 58, 05,
@@ -144,7 +143,6 @@
         msg = parser.parse(sample_msg2)
         self.assert_(ICheckinMessage.isImplementedBy(msg))
         self.assertEquals(msg.message_id, "42 at bar.com")
-        self.assertEquals(msg.author, "Foo Bar <foo.bar at bar.com>")
         self.assertEquals(msg.author_name, "Foo Bar")
         self.assertEquals(msg.author_email, "foo.bar at bar.com")
         self.assertEquals(msg.date, datetime(2003, 03, 28, 11, 58, 05,
@@ -157,6 +155,11 @@
         self.assertEquals(msg.body,
                           sample_msg2_text.split("\n\n", 1)[1])
 
+    def test_parser_empty(self):
+        from zopeproducts.z3checkins.message import CheckinMessageParser
+        from zopeproducts.z3checkins.interfaces import FormatError
+        parser = CheckinMessageParser()
+        self.assertRaises(FormatError, parser.parse, '')
 
     def test_parser_importmsg(self):
         from zopeproducts.z3checkins.message import CheckinMessageParser
@@ -168,7 +171,6 @@
         msg = parser.parse(sample_import_msg)
         self.assert_(ICheckinMessage.isImplementedBy(msg))
         self.assertEquals(msg.message_id, "42 at bar.com")
-        self.assertEquals(msg.author, "Foo Bar <foo.bar at bar.com>")
         self.assertEquals(msg.author_name, "Foo Bar")
         self.assertEquals(msg.author_email, "foo.bar at bar.com")
         self.assertEquals(msg.date, datetime(2003, 03, 28, 11, 58, 05,
@@ -192,7 +194,6 @@
         self.assert_(IMessage.isImplementedBy(msg))
         self.assert_(not ICheckinMessage.isImplementedBy(msg))
         self.assertEquals(msg.message_id, "q$w$e$r$t$y at example.com")
-        self.assertEquals(msg.author, "John Doe <john at example.com>")
         self.assertEquals(msg.author_name, "John Doe")
         self.assertEquals(msg.author_email, "john at example.com")
         self.assertEquals(msg.date, datetime(2003, 07, 29, 14, 42, 11,
@@ -209,7 +210,6 @@
         msg = parser.parse(svn_msg)
         self.assert_(ICheckinMessage.isImplementedBy(msg))
         self.assertEquals(msg.message_id, "20030908101551.6F900C32F at mail.pov.lt")
-        self.assertEquals(msg.author, "Albertas Agejevas <alga at pov.lt>")
         self.assertEquals(msg.author_name, "Albertas Agejevas")
         self.assertEquals(msg.author_email, "alga at pov.lt")
         self.assertEquals(msg.date, datetime(2003, 9, 8, 13, 15, 51,
@@ -230,7 +230,6 @@
         msg = parser.parse(svn_msg2)
         self.assert_(ICheckinMessage.isImplementedBy(msg))
         self.assertEquals(msg.message_id, "20030908101551.6F900C32F at mail.pov.lt")
-        self.assertEquals(msg.author, "Albertas Agejevas <alga at pov.lt>")
         self.assertEquals(msg.author_name, "Albertas Agejevas")
         self.assertEquals(msg.author_email, "alga at pov.lt")
         self.assertEquals(msg.date, datetime(2003, 9, 8, 13, 15, 51,
@@ -251,7 +250,6 @@
         msg = parser.parse(svn_msg3)
         self.assert_(IMessage.isImplementedBy(msg))
         self.assertEquals(msg.message_id, "20030909101551.6F900C32F at mail.pov.lt")
-        self.assertEquals(msg.author, "Albertas Agejevas <alga at pov.lt>")
         self.assertEquals(msg.author_name, "Albertas Agejevas")
         self.assertEquals(msg.author_email, "alga at pov.lt")
         self.assertEquals(msg.date, datetime(2003, 9, 8, 13, 15, 51,
@@ -264,10 +262,11 @@
     implements(ICheckinMessage, IMessageContained)
 
     def __init__(self, data=None, date=None, body=None, log_message='',
-                       message_id="message at id"):
+                       subject='', message_id="message at id"):
         self.data = data
         self.date = date
         self.body = body
+        self.subject = subject
         self.log_message = log_message
         self.message_id = message_id
 




More information about the Zope3-Checkins mailing list