Revision: 6742 Author: nicdumz Date: 2009-04-27 16:36:47 +0000 (Mon, 27 Apr 2009)
Log Message: ----------- Testing explicitely the two parsing modes of xmlreader.XmlDump: all revisions, or only the first one
Modified Paths: -------------- trunk/pywikipedia/tests/test-xmlreader.py
Modified: trunk/pywikipedia/tests/test-xmlreader.py =================================================================== --- trunk/pywikipedia/tests/test-xmlreader.py 2009-04-27 16:33:38 UTC (rev 6741) +++ trunk/pywikipedia/tests/test-xmlreader.py 2009-04-27 16:36:47 UTC (rev 6742) @@ -8,10 +8,16 @@ import xmlreader
class XmlReaderTestCase(unittest.TestCase): - def test_XmlDump(self): + def test_XmlDumpAllRevs(self): pages = [r for r in xmlreader.XmlDump("article-pear.xml", allrevisions=True).parse()] self.assertEquals(4, len(pages)) self.assertNotEquals("", pages[0].comment) + + def test_XmlDumpFirstRev(self): + pages = [r for r in xmlreader.XmlDump("article-pear.xml").parse()] + self.assertEquals(1, len(pages)) + self.assertNotEquals("", pages[0].comment) + def test_MediaWikiXmlHandler(self): handler = xmlreader.MediaWikiXmlHandler() pages = []
pywikipedia-svn@lists.wikimedia.org