http://www.mediawiki.org/wiki/Special:Code/pywikipedia/11616
Revision: 11616 Author: legoktm Date: 2013-06-02 12:49:02 +0000 (Sun, 02 Jun 2013) Log Message: ----------- Add test for page.getRedirectTarget()
Modified Paths: -------------- branches/rewrite/tests/page_tests.py
Modified: branches/rewrite/tests/page_tests.py =================================================================== --- branches/rewrite/tests/page_tests.py 2013-06-02 12:15:06 UTC (rev 11615) +++ branches/rewrite/tests/page_tests.py 2013-06-02 12:49:02 UTC (rev 11616) @@ -209,6 +209,12 @@ self.assertEqual(p2.isImage(), True) self.assertEqual(p3.isImage(), False)
+ def testIsRedirect(self): + p1 = pywikibot.Page(site, u'User:Legoktm/R1') + p2 = pywikibot.Page(site, u'User:Legoktm/R2') + self.assertTrue(p1.isRedirectPage()) + self.assertEqual(p1.getRedirectTarget(), p2) + def testApiMethods(self): """Test various methods that rely on API.""" # since there is no way to predict what data the wiki will return, @@ -312,7 +318,6 @@ ## def backlinks(self, followRedirects=True, filterRedirects=None, ## namespaces=None): ## def embeddedin(self, filter_redirects=None, namespaces=None): -## def getRedirectTarget(self): ## def getVersionHistory(self, reverseOrder=False, getAll=False, ## revCount=500): ## def getVersionHistoryTable(self, forceReload=False, reverseOrder=False,
pywikipedia-svn@lists.wikimedia.org