Rev 219: Added test for project-specific RSS feeds. in http://bzr.daniel-watkins.co.uk/pqm/rss

Daniel Watkins daniel at daniel-watkins.co.uk
Mon Jul 14 14:55:04 BST 2008


At http://bzr.daniel-watkins.co.uk/pqm/rss

------------------------------------------------------------
revno: 219
revision-id: daniel at daniel-watkins.co.uk-20080714135346-9qewhrxuf2wavb0a
parent: daniel at daniel-watkins.co.uk-20080714134636-6c6ecxxvyn8eb1ld
committer: Daniel Watkins <daniel at daniel-watkins.co.uk>
branch nick: rss
timestamp: Mon 2008-07-14 14:53:46 +0100
message:
  Added test for project-specific RSS feeds.
-------------- next part --------------
=== modified file 'pqm/ui/tests/test_twisted.py'
--- a/pqm/ui/tests/test_twisted.py	2008-07-14 13:46:36 +0000
+++ b/pqm/ui/tests/test_twisted.py	2008-07-14 13:53:46 +0000
@@ -299,7 +299,7 @@
     def removeBlankLines(self, string):
         return '\n'.join([l for l in string.split('\n') if not l.isspace()])
 
-    def testRSS(self):
+    def testMainRSS(self):
         queue = self.getResource()
         request = DummyRequest(['rss.xml'])
         result_resource = getChildForRequest(queue, request)
@@ -330,6 +330,37 @@
                     '</rss>')
         self.assertDocTest(expected, rss)
 
+    def testProjectSpecificRSS(self):
+        queue = self.getResource()
+        request = DummyRequest(['project', 'rss.xml'])
+        result_resource = getChildForRequest(queue, request)
+        rss = self.removeBlankLines(result_resource.render(request))
+        expected = ('<?xml version="1.0" encoding="iso-8859-1"?>\n'
+                    '<rss version="2.0">\n'
+                    '  <channel>\n'
+                    '    <title>Patch Queue Manager Queue</title>\n'
+                    '    <link></link>\n'
+                    '    <description></description>\n'
+                    '    <item>\n'
+                    '        <title>Now Playing: A new action</title>\n'
+                    '        <author>John.Citizen at example.com</author>\n'
+                    '        <description>Merge archive at example.com/foo--bar--0 archive2 at example.com/bar--foo--1\n&lt;foo\nbar\nbaz\nquux\ntheta\n</description>\n'
+                    '        <pubDate>...</pubDate>\n'
+                    '    </item>'
+                    '<item>\n'
+                    '        <title>A new action</title>\n'
+                    '        <author>John.Citizen at example.com</author>\n'
+                    '        <description>Merge archive at example.com/foo--bar--0 unregistered at example.com/bar--foo--1</description>\n'
+                    '        <pubDate>...</pubDate>\n'
+                    '    </item>'
+                    '<item>\n'
+                    '        <title>A request for another project</title>\n'
+                    '        <pubDate>...</pubDate>\n'
+                    '    </item>\n'
+                    '  </channel>\n'
+                    '</rss>')
+        self.assertDocTest(expected, rss)
+
     def testEmptyQueue(self):
         queue = self.getResource(empty=True)
         request = DummyRequest(['rss.xml'])



More information about the bazaar-commits mailing list