[Zope3-checkins] CVS: zopeproducts/z3checkins/tests - test_message.py:1.13

Albertas Agejevas alga at pov.lt
Tue Sep 9 19:16:34 EDT 2003


Update of /cvs-repository/zopeproducts/z3checkins/tests
In directory cvs.zope.org:/tmp/cvs-serv17584/tests

Modified Files:
	test_message.py 
Log Message:
Added support for messages generated by Subversion's commit-email.pl script.
Now ready for Subversion!

Made a marker interface ICheckinsFolder.  It has to be applied on a folder
manually though.


=== zopeproducts/z3checkins/tests/test_message.py 1.12 => 1.13 ===
--- zopeproducts/z3checkins/tests/test_message.py:1.12	Fri Aug  1 05:43:23 2003
+++ zopeproducts/z3checkins/tests/test_message.py	Tue Sep  9 18:16:33 2003
@@ -203,6 +203,46 @@
 This is just a simple message.
 """
 
+    svn_msg = """\
+To: checkins at lists.schooltool.org
+From: Albertas Agejevas <alga at pov.lt>
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+Message-Id: <20030908101551.6F900C32F at mail.pov.lt>
+Date: Mon,  8 Sep 2003 13:15:51 +0300 (EEST)
+Subject: [schooltool-checkins] rev 10 - trunk/schooltool
+
+Author: alga
+Date: 2003-09-08 13:15:50 +0300 (Mon, 08 Sep 2003)
+New Revision: 10
+
+Modified:
+   trunk/schooltool/README
+Log:
+Added a period.
+
+
+Modified: trunk/schooltool/README
+===================================================================
+--- trunk/schooltool/README	2003-09-05 16:54:07 UTC (rev 9)
++++ trunk/schooltool/README	2003-09-08 10:15:50 UTC (rev 10)
+@@ -1,7 +1,7 @@
+ SchoolTool
+ ==========
+ 
+-SchoolTool - common information systems platform for school administration
++SchoolTool - common information systems platform for school administration.
+ 
+ Website: http://www.schooltool.org/
+ 
+
+_______________________________________________
+Checkins mailing list
+Checkins at lists.schooltool.org
+http://lists.schooltool.org/mailman/listinfo/checkins
+"""
+
+
     def test_interface(self):
         from zopeproducts.z3checkins.message import CheckinMessageParser
         verifyObject(IMessageParser, CheckinMessageParser())
@@ -282,6 +322,24 @@
                                              tzinfo=FixedTimezone(2*60)))
         self.assertEquals(msg.body, self.simple_msg.split("\n\n", 1)[1])
 
+    def test_parser_svnmsg(self):
+        from zopeproducts.z3checkins.message import CheckinMessageParser
+        from zopeproducts.z3checkins.message import FixedTimezone
+        parser = CheckinMessageParser()
+        msg = parser.parse(StringIO(self.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,
+                                             tzinfo=FixedTimezone(3*60)))
+        self.assertEquals(msg.directory, "trunk/schooltool")
+        self.assertEquals(msg.branch, None)
+        self.assertEquals(msg.log_message, """Added a period.""")
+        self.assertEquals(msg.body,
+                          self.svn_msg.split("\n\n", 1)[1])
+
 
 class MessageStub:
 
@@ -777,6 +835,67 @@
                     'signature\n'
                     '</div>'
                     '</pre>')
+        self.assertEquals(result, expected, diff(expected, result))
+
+    def test_body_svn(self):
+        from zopeproducts.z3checkins.message import CheckinMessageView
+        view = CheckinMessageView()
+        view.context = MessageStub(body="""\
+Author: mg
+Date: 2003-09-09 21:21:09 +0300 (Tue, 09 Sep 2003)
+New Revision: 15
+
+Added:
+   trunk/schooltool/schooltool/ftests/
+   trunk/schooltool/schooltool/ftests/__init__.py
+   trunk/schooltool/schooltool/ftests/test_rest.py
+   trunk/schooltool/schooltool/main.py
+   trunk/schooltool/schooltool/tests/test_main.py
+Removed:
+   trunk/schooltool/schooltool/tests/test_rest.py
+Modified:
+   trunk/schooltool/schooltool/tests/__init__.py
+Log:
+First prototype of SchoolTool HTTP server that serves RESTful pages, complete
+with unit and functional tests.
+
+
+
+Added: trunk/schooltool/schooltool/ftests/__init__.py
+===================================================================
+--- trunk/schooltool/schooltool/ftests/__init__.py	2003-09-09 18:03:43 UTC (rev 14)
++++ trunk/schooltool/schooltool/ftests/__init__.py	2003-09-09 18:21:09 UTC (rev 15)
+@@ -0,0 +1,21 @@
++#
++# SchoolTool - common information systems platform for school administration
+"""
+)
+        result = view.body()
+        expected = ("""\
+<pre>Author: mg
+Date: 2003-09-09 21:21:09 +0300 (Tue, 09 Sep 2003)
+New Revision: 15
+
+Added:
+   trunk/schooltool/schooltool/ftests/
+   trunk/schooltool/schooltool/ftests/__init__.py
+   trunk/schooltool/schooltool/ftests/test_rest.py
+   trunk/schooltool/schooltool/main.py
+   trunk/schooltool/schooltool/tests/test_main.py
+Removed:
+   trunk/schooltool/schooltool/tests/test_rest.py
+Modified:
+   trunk/schooltool/schooltool/tests/__init__.py
+Log:
+</pre><div class="log"><p>First prototype of SchoolTool HTTP server that serves RESTful pages, complete</p><p>with unit and functional tests.</p></div><pre>
+Added: trunk/schooltool/schooltool/ftests/__init__.py
+<div class="file">===================================================================
+</div><div class="oldfile">--- trunk/schooltool/schooltool/ftests/__init__.py<span class="tab">>------</span>2003-09-09 18:03:43 UTC (rev 14)
+</div><div class="newfile">+++ trunk/schooltool/schooltool/ftests/__init__.py<span class="tab">>------</span>2003-09-09 18:21:09 UTC (rev 15)
+</div><div class="chunk">@@ -0,0 +1,21 @@
+</div><div class="new">+#
+</div><div class="new">+# SchoolTool - common information systems platform for school administration</div></pre>"""
+                    )
         self.assertEquals(result, expected, diff(expected, result))
 
     def test_body_crlf(self):




More information about the Zope3-Checkins mailing list